def on_step_begin(self, step, logs):
if self.step % self.interval == <NUM_LIT:0>:<EOL><INDENT>if len(self.episode_rewards) > <NUM_LIT:0>:<EOL><INDENT>metrics = np.array(self.metrics)<EOL>assert metrics.shape == (self.interval, len(self.metrics_names))<EOL>formatted_metrics = '<STR_LIT>'<EOL>if not np.isnan(metrics).all():  <EOL><INDENT>means = np.nanmean(self.metrics, axis=<NUM_LIT:0>)<EOL>assert means.shape == (len(self.metrics_names),)<EOL>for name, mean in zip(self.metrics_names, means):<EOL><INDENT>formatted_metrics += '<STR_LIT>'.format(name, mean)<EOL><DEDENT><DEDENT>formatted_infos = '<STR_LIT>'<EOL>if len(self.infos) > <NUM_LIT:0>:<EOL><INDENT>infos = np.array(self.infos)<EOL>if not np.isnan(infos).all():  <EOL><INDENT>means = np.nanmean(self.infos, axis=<NUM_LIT:0>)<EOL>assert means.shape == (len(self.info_names),)<EOL>for name, mean in zip(self.info_names, means):<EOL><INDENT>formatted_infos += '<STR_LIT>'.format(name, mean)<EOL><DEDENT><DEDENT><DEDENT>print('<STR_LIT>'.format(len(self.episode_rewards), np.mean(self.episode_rewards), np.min(self.episode_rewards), np.max(self.episode_rewards), formatted_metrics, formatted_infos))<EOL>print('<STR_LIT>')<EOL><DEDENT>self.reset()<EOL>print('<STR_LIT>'.format(self.step // self.interval + <NUM_LIT:1>, self.step))<EOL><DEDENT>
Print metrics if interval is over