Train one step. Returns: bool: Whether to continue training. Dict: Metrics of the training step.
(self, exps: List[Experience])
| 176 | return self.config.trainer.name |
| 177 | |
| 178 | async def train_step(self, exps: List[Experience]) -> Dict: |
| 179 | """Train one step. |
| 180 | |
| 181 | Returns: |
| 182 | bool: Whether to continue training. |
| 183 | Dict: Metrics of the training step. |
| 184 | """ |
| 185 | self.logger.info(f"Training at step {self.train_step_num + 1} started.") |
| 186 | metrics = {} |
| 187 | with Timer(metrics, "time/train_step"): |
| 188 | train_metrics = await self.engine.train_step(exps) |
| 189 | self.logger.info(f"Training at step {self.train_step_num} finished.") |
| 190 | metrics.update(train_metrics) |
| 191 | return metrics |
| 192 | |
| 193 | async def _sample_data(self) -> Tuple[List[Experience], Dict, List[Dict]]: |
| 194 | """Sample a batch of experiences. |