MCPcopy Create free account
hub / github.com/agentscope-ai/Trinity-RFT / train_step

Method train_step

trinity/trainer/trainer.py:178–191  ·  view source on GitHub ↗

Train one step. Returns: bool: Whether to continue training. Dict: Metrics of the training step.

(self, exps: List[Experience])

Source from the content-addressed store, hash-verified

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.

Callers 1

trainMethod · 0.95

Calls 2

TimerClass · 0.90
updateMethod · 0.45

Tested by

no test coverage detected