callback¶
- class xuance.common.callback.BaseCallback(*args, **kwargs)[源代码]¶
基类:
ABCBase class for callback hooks in reinforcement learning training and testing.
Users can inherit this class to implement custom logic during different stages of training and evaluation.
- on_test_end(*args, **kwargs)[源代码]¶
Called at the end of the testing loop.
- 参数:
*args – Optional positional arguments.
**kwargs – Optional keyword arguments.
- on_test_step(*args, **kwargs)[源代码]¶
Called during each step in the testing loop.
- 参数:
*args – Optional positional arguments.
**kwargs – Optional keyword arguments.
- on_train_episode_info(**kwargs)[源代码]¶
Called at the termination or truncation of one episode for an environment.
- on_train_epochs_end(current_step, **kwargs)[源代码]¶
Called after each training epoch (i.e., after collecting one transition). :param current_step: The current global training step. :type current_step: int :param **kwargs: Additional optional information.
- on_train_step(current_step, **kwargs)[源代码]¶
Called after each training step (i.e., after collecting one transition).
- 参数:
current_step (int) – The current global training step.
**kwargs – Additional optional information.
- on_train_step_end(current_step, **kwargs)[源代码]¶
Called after a training step is completed (includes update, logging, etc.).
- 参数:
current_step (int) – The current global training step.
envs_info – Environment information.
train_info – Training information.
- class xuance.common.callback.MultiAgentBaseCallback(*args, **kwargs)[源代码]¶
基类:
BaseCallback