training_loop#
- abstractmethod BaseTrainer.training_loop() None[source]#
Loop called by fit() to run training and report results to Tune.
Note
This method runs on a remote process.
self.datasetshave already been evaluated if they were wrapped in a factory.You can use the Ray Train utilities (
train.report()andtrain.get_checkpoint()) inside this training loop.Examples
>>> from ray.train.trainer import BaseTrainer >>> from ray import train >>> class MyTrainer(BaseTrainer): ... def training_loop(self): ... for epoch_idx in range(5): ... ... ... train.report({"epoch": epoch_idx})