sinergym.utils.callbacks.LoggerEvalCallback

class sinergym.utils.callbacks.LoggerEvalCallback(*args: Any, **kwargs: Any)

Callback for evaluating an agent. :param eval_env: The environment used for initialization :param callback_on_new_best: Callback to trigger when there is a new best model according to the mean reward :param n_eval_episodes: The number of episodes to test the agent :param eval_freq: Evaluate the agent every eval freq call of the callback. :param log_path: Path to a folder where the evaluations (evaluations.npz) will be saved. It will be updated at each evaluation. :param best_model_save_path: Path to a folder where the best model according to performance on the eval env will be saved. :param deterministic: Whether the evaluation should use a stochastic or deterministic actions. :param render: Whether to render or not the environment during evaluation :param verbose: :param warn: Passed to evaluate policy (warns if eval env has not been wrapped with a Monitor wrapper)

__init__(eval_env: Env | stable_baselines3.common.vec_env.VecEnv, callback_on_new_best: stable_baselines3.common.callbacks.BaseCallback | None = None, callback_after_eval: stable_baselines3.common.callbacks.BaseCallback | None = None, n_eval_episodes: int = 5, eval_freq: int = 10000, log_path: str | None = None, best_model_save_path: str | None = None, deterministic: bool = True, render: bool = False, verbose: int = 1, warn: bool = True)

Methods

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

update_child_locals(locals_)

Update the references to the local variables.

update_child_locals(locals_: Dict[str, Any]) None

Update the references to the local variables.

Parameters:

locals – the local variables during rollout collection