def train_epoch(self, epoch_info: EpochInfo, interactive=True) -> None:
epoch_info.on_epoch_begin()<EOL>if interactive:<EOL><INDENT>iterator = tqdm.trange(epoch_info.batches_per_epoch, file=sys.stdout, desc="<STR_LIT>", unit="<STR_LIT>")<EOL><DEDENT>else:<EOL><INDENT>iterator = range(epoch_info.batches_per_epoch)<EOL><DEDENT>for batch_idx in iterator:<EOL><INDENT>batch_info = BatchInfo(epoch_info, batch_idx)<EOL>batch_info.on_batch_begin()<EOL>self.train_batch(batch_info)<EOL>batch_info.on_batch_end()<EOL><DEDENT>epoch_info.result_accumulator.freeze_results()<EOL>epoch_info.on_epoch_end()<EOL>
Train model for a single epoch