ethicalgardeners.algorithms.train

ethicalgardeners.algorithms.train(model, algorithm_name: str = 'maskable_ppo', total_timesteps=10000)[source]

Train a given model and save it.

Parameters:
  • model – A model instance to train. The model class should contain a learn method and a save method as in Stable Baselines3.

  • algorithm_name – The algorithm name (e.g., “maskable_ppo”, “dqn”). It is used in the saved file’s name.

  • total_timesteps – The total number of timesteps to train the model.