rl_serial_algorithm_trainer

Module rl_serial_algorithm_trainer Specifies an interface to train serial RL algorithms

class rl_serial_algorithm_trainer.RLSerialTrainerConfig(n_episodes: int = 0, tolerance: float = 1e-08, output_msg_frequency: int = - 1, render_env: bool = False)

The RLSerialTrainerConfig class. Configuration class for RLSerialAgentTrainer

class rl_serial_algorithm_trainer.RLSerialAgentTrainer(config: RLSerialTrainerConfig, algorithm: Algorithm)

The RLSerialAgentTrainer class handles the training for serial reinforcement learning agents

__init__(config: RLSerialTrainerConfig, algorithm: Algorithm)

Constructor

Parameters
  • config (Configuration for the trainer) –

  • algorithm (The algorithm to train) –

actions_after_episode_ends(env: Env, **options) None
Execute any needed actions after the

training episode begins

Parameters
  • env (The environment to train the algorithm) –

  • options (Any options passed by the client) –

Return type

None

actions_after_training_ends(env: Env, **options) None

Execute any actions the algorithm needs after training episodes are finished

Parameters
  • env (The environment to train the algorithm) –

  • options (Any options passed by the client) –

Return type

None

actions_before_episode_begins(env: Env, **options) None
Execute any needed actions before the

training episode begins

Parameters
  • env (The environment to train the algorithm) –

  • options (Any options passed by the client) –

Return type

None

actions_before_training_begins(env: Env, **options) None

Execute any actions the algorithm needs before training starts

Parameters
  • env (The environment to train the algorithm) –

  • options (Any options passed by the client) –

Return type

None

train(env: Env, **options) ItrControlResult

Train the algorithm on the given environment

Parameters
  • env (The environment to train the algorithm) –

  • options (Any options passed by the client) –

Return type

An instance of ItrControlResult class