basic_utils/utils.py
def add_path_info(self, path_info, extra_info, flag='train'):
        """
        Save the game play information.

        Args:
            path_info: the information about rewards
            extra_info: optional additional information
        """
        epi_rewards = []
        path_lens = []
        for p in path_info:
            reward = np.sum(p)
            epi_rewards.append(reward)
            path_lens.append(len(p))
            self.writer.add_scalar('episode_data/reward_' + flag, reward, self.epi_counter)
            self.writer.add_scalar('episode_data/path_length_' + flag, len(p), self.epi_counter)
            self.epi_counter += 1
        for d in extra_info:
            self.writer.add_scalar('extra_info/' + d + '_' + flag, extra_info[d], self.epi_counter)

        if flag == 'train':
            self.path_info['episoderewards'] += epi_rewards
            self.path_info['pathlengths'] += path_lens
            for d in extra_info:
                self.extra_info[d] = extra_info[d]

        Save the game play information.

        Args:
            path_info: the information about rewards
            extra_info: optional additional information
        
Save the game play information.
Save the game play information .
def add_path_info(self, path_info, extra_info, flag='train'):
        epi_rewards = []
        path_lens = []
        for p in path_info:
            reward = np.sum(p)
            epi_rewards.append(reward)
            path_lens.append(len(p))
            self.writer.add_scalar('episode_data/reward_' + flag, reward, self.epi_counter)
            self.writer.add_scalar('episode_data/path_length_' + flag, len(p), self.epi_counter)
            self.epi_counter += 1
        for d in extra_info:
            self.writer.add_scalar('extra_info/' + d + '_' + flag, extra_info[d], self.epi_counter)
        if flag == 'train':
            self.path_info['episoderewards'] += epi_rewards
            self.path_info['pathlengths'] += path_lens
            for d in extra_info:
                self.extra_info[d] = extra_info[d]
def add_path_info ( self , path_info , extra_info , flag = 'train' ) : epi_rewards = [ ] path_lens = [ ] for p in path_info : reward = np . sum ( p ) epi_rewards . append ( reward ) path_lens . append ( len ( p ) ) self . writer . add_scalar ( 'episode_data/reward_' + flag , reward , self . epi_counter ) self . writer . add_scalar ( 'episode_data/path_length_' + flag , len ( p ) , self . epi_counter ) self . epi_counter += 1 for d in extra_info : self . writer . add_scalar ( 'extra_info/' + d + '_' + flag , extra_info [ d ] , self . epi_counter ) if flag == 'train' : self . path_info [ 'episoderewards' ] += epi_rewards self . path_info [ 'pathlengths' ] += path_lens for d in extra_info : self . extra_info [ d ] = extra_info [ d ]
Save the game play information.
Save the game play information .
"""
        Save the game play information.

        Args:
            path_info: the information about rewards
            extra_info: optional additional information
        """
self
path_info
the information about rewards
the information about rewards
extra_info
optional additional information
optional additional information
flag