def train_on_replay_memory(self, batch_info):
self.model.train()<EOL>batch_info['<STR_LIT>'] = []<EOL>for i in range(self.settings.training_rounds):<EOL><INDENT>sampled_rollout = self.env_roller.sample(batch_info, self.model, self.settings.training_steps)<EOL>batch_result = self.algo.optimizer_step(<EOL>batch_info=batch_info,<EOL>device=self.device,<EOL>model=self.model,<EOL>rollout=sampled_rollout.to_device(self.device)<EOL>)<EOL>self.env_roller.update(rollout=sampled_rollout, batch_info=batch_result)<EOL>batch_info['<STR_LIT>'].append(batch_result)<EOL><DEDENT>batch_info.aggregate_key('<STR_LIT>')<EOL>
Train agent on a memory gotten from replay buffer