Skip to content

lit_sb3.callbacks.maskable_eval

source module lit_sb3.callbacks.maskable_eval

Classes

source class MaskableEvalCallback(*args, use_masking: bool = True, **kwargs)

Bases : EvalCallback

Callback for evaluating an agent. Supports invalid action masking.

Parameters

  • eval_env — The environment used for initialization

  • callback_on_new_best — Callback to trigger when there is a new best model according to the mean_reward

  • callback_after_eval — Callback to trigger after every evaluation when there is a new best model according to the mean_reward

  • n_eval_episodes — The number of episodes to test the agent

  • eval_freq — Evaluate the agent every eval_freq call of the callback.

  • log_path — Path to a folder where the evaluations (evaluations.npz) will be saved. It will be updated at each evaluation.

  • best_model_save_path — Path to a folder where the best model according to performance on the eval env will be saved.

  • deterministic — Whether the evaluation should use a stochastic or deterministic actions.

  • render — Whether to render or not the environment during evaluation

  • verbose

  • warn — Passed to evaluate_policy (warns if eval_env has not been wrapped with a Monitor wrapper)

  • use_masking : bool — Whether to use invalid action masks during evaluation

Attributes

  • state_key : str — Identifier for the state of the callback.