cambrian.ml.trainer¶
This module contains the trainer class for training and evaluating agents.
Classes¶
Settings for the training process. Used for type hinting. |
|
This is the trainer class for running training and evaluation. |
Module Contents¶
- class MjCambrianTrainerConfig[source]¶
Bases:
hydra_config.HydraContainerConfig
Settings for the training process. Used for type hinting.
- Variables:
total_timesteps (int) – The total number of timesteps to train for.
max_episode_steps (int) – The maximum number of steps per episode.
n_envs (int) – The number of parallel environments to use for training.
model (Callable[[MjCambrianEnv], MjCambrianModel]) – The model to use for training.
callbacks (Dict[str, BaseCallback]) – The callbacks to use for training.
wrappers (Dict[str, Callable[[VecEnv], VecEnv]] | None) – The wrappers to use for training. If None, will ignore.
prune_fn (Optional[Callable[[MjCambrianConfig], bool]]) – The function to use to determine if an experiment should be pruned. If None, will ignore. If set, this function will be called prior to training to check whether the config is valid for training. This is the get around the fact that some sweepers will evaluate configs that are invalid for training, which is a waste computationally. The train method will return -inf if this function returns True. NOTE: for nevergrad, it is recommended to use cheap_constraints.
fitness_fn (Callable[[MjCambrianConfig, float]]) – The function to use to calculate the fitness of the agent after training.