def train_batch(self, batch_info: BatchInfo) -> None:
<EOL>self.model.train()<EOL>rollout = self.env_roller.rollout(batch_info, self.model, self.settings.number_of_steps)<EOL>rollout = self.algo.process_rollout(batch_info, rollout)<EOL>batch_info['<STR_LIT>'] = []<EOL>if self.settings.shuffle_transitions:<EOL><INDENT>rollout = rollout.to_transitions()<EOL><DEDENT>if self.settings.stochastic_experience_replay:<EOL><INDENT>experience_replay_count = max(np.random.poisson(self.settings.experience_replay), <NUM_LIT:1>)<EOL><DEDENT>else:<EOL><INDENT>experience_replay_count = self.settings.experience_replay<EOL><DEDENT>for i in range(experience_replay_count):<EOL><INDENT>if self.settings.batch_size >= rollout.frames():<EOL><INDENT>batch_result = self.algo.optimizer_step(<EOL>batch_info=batch_info,<EOL>device=self.device,<EOL>model=self.model,<EOL>rollout=rollout.to_device(self.device)<EOL>)<EOL>batch_info['<STR_LIT>'].append(batch_result)<EOL><DEDENT>else:<EOL><INDENT>for batch_rollout in rollout.shuffled_batches(self.settings.batch_size):<EOL><INDENT>batch_result = self.algo.optimizer_step(<EOL>batch_info=batch_info,<EOL>device=self.device,<EOL>model=self.model,<EOL>rollout=batch_rollout.to_device(self.device)<EOL>)<EOL>batch_info['<STR_LIT>'].append(batch_result)<EOL><DEDENT><DEDENT><DEDENT>batch_info['<STR_LIT>'] = rollout.frames()<EOL>batch_info['<STR_LIT>'] = rollout.episode_information()<EOL>batch_info.aggregate_key('<STR_LIT>')<EOL>
Batch - the most atomic unit of learning.

For this reinforforcer, that involves:

1. Roll out the environmnent using current policy
2. Use that rollout to train the policy