def summarize(self):
    if ('global_step_critic' in self.stats.keys()):
        self.final_stats['global_step'] = self.stats['global_step_critic']
    if ('online_rewards' in self.stats.keys()):
        self.stats['online_rewards'] = np.array(self.stats['online_rewards'])
        self.stats['online_rewards'] = np.reshape(self.stats['online_rewards'], [self.stats['online_rewards'].shape[1], (- 1)])
        self.final_stats['online_rewards'] = np.mean(self.stats['online_rewards'][:, 10:])
    if ('q_loss' in self.stats.keys()):
        self.final_stats['q_loss'] = np.mean(self.stats['q_loss'])
    if ('states' in self.stats.keys()):
        self.final_stats['states'] = np.transpose(np.squeeze(np.array(self.stats['states'])))
    if ('actions' in self.stats.keys()):
        self.final_stats['actions'] = np.swapaxes(np.array(self.stats['actions']), 0, 1)
    if ('disturbance' in self.stats.keys()):
        self.final_stats['disturbance'] = np.transpose(np.array(self.stats['disturbance']))
    if ('g_norm_critic' in self.stats.keys()):
        self.final_stats['g_norm_critic'] = (np.mean(np.squeeze(np.array(self.stats['g_norm_critic']))), np.min(np.squeeze(np.array(self.stats['g_norm_critic']))), np.max(np.squeeze(np.array(self.stats['g_norm_critic']))))
    if ('g_norm_actor' in self.stats.keys()):
        self.final_stats['g_norm_actor'] = (np.mean(np.squeeze(np.array(self.stats['g_norm_actor']))), np.min(np.squeeze(np.array(self.stats['g_norm_actor']))), np.max(np.squeeze(np.array(self.stats['g_norm_actor']))))
    if ('global_step_actor' in self.stats.keys()):
        self.final_stats['global_step'] = self.stats['global_step_actor'][(- 1)]
    self.total_time = (time.time() - self.total_time)
    del self.stats
def summarize(self):
    if ('global_step_critic' in self.stats.keys()):
        self.final_stats['global_step'] = self.stats['global_step_critic']
    if ('online_rewards' in self.stats.keys()):
        self.stats['online_rewards'] = np.array(self.stats['online_rewards'])
        self.stats['online_rewards'] = np.reshape(self.stats['online_rewards'], [self.stats['online_rewards'].shape[1], (- 1)])
        self.final_stats['online_rewards'] = np.mean(self.stats['online_rewards'][:, 10:])
    if ('q_loss' in self.stats.keys()):
        self.final_stats['q_loss'] = np.mean(self.stats['q_loss'])
    if ('states' in self.stats.keys()):
        self.final_stats['states'] = np.transpose(np.squeeze(np.array(self.stats['states'])))
    if ('actions' in self.stats.keys()):
        self.final_stats['actions'] = np.swapaxes(np.array(self.stats['actions']), 0, 1)
    if ('disturbance' in self.stats.keys()):
        self.final_stats['disturbance'] = np.transpose(np.array(self.stats['disturbance']))
    if ('g_norm_critic' in self.stats.keys()):
        self.final_stats['g_norm_critic'] = (np.mean(np.squeeze(np.array(self.stats['g_norm_critic']))), np.min(np.squeeze(np.array(self.stats['g_norm_critic']))), np.max(np.squeeze(np.array(self.stats['g_norm_critic']))))
    if ('g_norm_actor' in self.stats.keys()):
        self.final_stats['g_norm_actor'] = (np.mean(np.squeeze(np.array(self.stats['g_norm_actor']))), np.min(np.squeeze(np.array(self.stats['g_norm_actor']))), np.max(np.squeeze(np.array(self.stats['g_norm_actor']))))
    if ('global_step_actor' in self.stats.keys()):
        self.final_stats['global_step'] = self.stats['global_step_actor'][(- 1)]
    self.total_time = (time.time() - self.total_time)
    del self.stats