commonpower.control.logging_utils.callbacks.MARLWandBCallback
- class MARLWandBCallback(verbose: int = 0, model_save_path: str | None = None, model_save_freq: int = 0, log: Literal['gradients', 'parameters', 'all'] | None = 'all')[source]
Bases:
MARLBaseCallbackCallback for logging experiments to Weights and Biases.
- Log MAPPO experiments to Weights and Biases
Added model tracking and uploading
Added complete hyperparameters recording
Note that wandb.init(…) must be called before the WandbCallback can be used.
- Parameters:
verbose (int) – The verbosity of output
model_save_path (Optional[str]) – Path to the folder where the model will be saved, The default value is None so the model is not logged
model_save_freq (int) – Frequency to save the model
log (Optional[Literal["gradients", "parameters", "all"]]) – What to log. One of “gradients”, “parameters”, or “all”.
Methods
init_callbackInitialize the callback by saving references to the RL runner and the training environment for convenience.
on_rollout_endAny operations the callback has to perform at the end of one training episode
on_rollout_starton_stepThis method will be called by the runner after each call to
env.step().on_training_endAny operations the callback has to perform after the training is finished
on_training_startAny operations the callback has to perform before the training starts
Call the runner to save the actor and critic parameters of each agent
update_child_localsUpdate the references to the local variables on sub callbacks.
update_localsUpdate the references to the local variables.
update_num_timestepsAttributes
runnerlogger- _on_step() bool[source]
Internal operation that should be performed in each step. Here we want to save the model from time to time.
- Returns:
(bool) – If the callback returns False, training is aborted early.