autorl/agents.py
def _batch(self, data):
        """
        Parse the raw state, action, reward episode data into a batch
        for updating the action value network.
        :param data: Data collected from train loop
        :return: Numpy batches
        """

        states, actions, rewards = zip(*data)
        state_array = np.array(states).reshape([len(data)] + self._state_dim)
        target_array = np.zeros((len(data), self._action_dim))

        # iterate over states and construct mc-target
        #TODO: refactor to compute targets over whole state trajectory simultaneously
        for i, s in enumerate(states):
            target_vector = self.q_eval(s, reshape=self._action_dim)
            target_vector[actions[i]] = self._return(rewards[i:])
            target_array[i,:] = target_vector

        return state_array, target_array

        Parse the raw state, action, reward episode data into a batch
        for updating the action value network.
        :param data: Data collected from train loop
        :return: Numpy batches
        
Parse the raw state, action, reward episode data into a batch
for updating the action value network.
Parse the raw state action reward episode data into a batch for updating the action value network .
def _batch(self, data):
        states, actions, rewards = zip(*data)
        state_array = np.array(states).reshape([len(data)] + self._state_dim)
        target_array = np.zeros((len(data), self._action_dim))
        for i, s in enumerate(states):
            target_vector = self.q_eval(s, reshape=self._action_dim)
            target_vector[actions[i]] = self._return(rewards[i:])
            target_array[i,:] = target_vector
        return state_array, target_array
def _batch ( self , data ) : states , actions , rewards = zip ( * data ) state_array = np . array ( states ) . reshape ( [ len ( data ) ] + self . _state_dim ) target_array = np . zeros ( ( len ( data ) , self . _action_dim ) ) for i , s in enumerate ( states ) : target_vector = self . q_eval ( s , reshape = self . _action_dim ) target_vector [ actions [ i ] ] = self . _return ( rewards [ i : ] ) target_array [ i , : ] = target_vector return state_array , target_array
Parse the raw state, action, reward episode data into a batch
for updating the action value network.
Parse the raw state action reward episode data into a batch for updating the action value network .
"""
        Parse the raw state, action, reward episode data into a batch
        for updating the action value network.
        :param data: Data collected from train loop
        :return: Numpy batches
        """ # iterate over states and construct mc-target #TODO: refactor to compute targets over whole state trajectory simultaneously
None
self
data
Data collected from train loop
Data collected from train loop