sinergym.utils.callbacks.LoggerEvalCallback

class sinergym.utils.callbacks.LoggerEvalCallback(*args: Any, **kwargs: Any)
__init__(eval_env: Env | stable_baselines3.common.vec_env.VecEnv, train_env: Env | stable_baselines3.common.vec_env.VecEnv, n_eval_episodes: int = 5, eval_freq_episodes: int = 5, deterministic: bool = True, excluded_metrics: List[str] = ['episode_num', 'length (timesteps)', 'time_elapsed (hours)'], verbose: int = 1)

Callback for evaluating an agent during training process logging all important data in WandB platform if is activated. It must be wrapped with BaseLoggerWrapper child class.

Parameters:
  • eval_env (Union[gym.Env, VecEnv]) – Environment to evaluate the agent.

  • train_env (Union[gym.Env, VecEnv]) – Environment used for training.

  • n_eval_episodes (int, optional) – Number of episodes to evaluate the agent. Defaults to 5.

  • eval_freq_episodes (int, optional) – Evaluate the agent every eval_freq call of the callback. Defaults to 5.

  • deterministic (bool, optional) – Whether the evaluation should use a stochastic or deterministic actions. Defaults to True.

  • excluded_metrics (List[str], optional) – List of metrics to exclude from the evaluation. Defaults to [‘episode_num’, ‘length (timesteps)’, ‘time_elapsed (hours)’].

  • verbose (int, optional) – Verbosity level. Defaults to 1.

Methods

__init__(eval_env, train_env[, ...])

Callback for evaluating an agent during training process logging all important data in WandB platform if is activated.