ray.rllib.algorithms.algorithm_config.AlgorithmConfig.callbacks#

AlgorithmConfig.callbacks(callbacks_class: ~typing.Type[~ray.rllib.callbacks.callbacks.RLlibCallback] | ~typing.List[~typing.Type[~ray.rllib.callbacks.callbacks.RLlibCallback]] | None = <ray.rllib.utils.from_config._NotProvided object>, *, on_algorithm_init: ~typing.Callable | ~typing.List[~typing.Callable] | None = <ray.rllib.utils.from_config._NotProvided object>, on_train_result: ~typing.Callable | ~typing.List[~typing.Callable] | None = <ray.rllib.utils.from_config._NotProvided object>, on_evaluate_start: ~typing.Callable | ~typing.List[~typing.Callable] | None = <ray.rllib.utils.from_config._NotProvided object>, on_evaluate_end: ~typing.Callable | ~typing.List[~typing.Callable] | None = <ray.rllib.utils.from_config._NotProvided object>, on_env_runners_recreated: ~typing.Callable | ~typing.List[~typing.Callable] | None = <ray.rllib.utils.from_config._NotProvided object>, on_checkpoint_loaded: ~typing.Callable | ~typing.List[~typing.Callable] | None = <ray.rllib.utils.from_config._NotProvided object>, on_environment_created: ~typing.Callable | ~typing.List[~typing.Callable] | None = <ray.rllib.utils.from_config._NotProvided object>, on_episode_created: ~typing.Callable | ~typing.List[~typing.Callable] | None = <ray.rllib.utils.from_config._NotProvided object>, on_episode_start: ~typing.Callable | ~typing.List[~typing.Callable] | None = <ray.rllib.utils.from_config._NotProvided object>, on_episode_step: ~typing.Callable | ~typing.List[~typing.Callable] | None = <ray.rllib.utils.from_config._NotProvided object>, on_episode_end: ~typing.Callable | ~typing.List[~typing.Callable] | None = <ray.rllib.utils.from_config._NotProvided object>, on_sample_end: ~typing.Callable | ~typing.List[~typing.Callable] | None = <ray.rllib.utils.from_config._NotProvided object>) AlgorithmConfig[source]#

Sets the callbacks configuration.

Parameters:
  • callbacks_class – RLlibCallback class, whose methods are called during various phases of training and RL environment sample collection. TODO (sven): Change the link to new rst callbacks page. See the RLlibCallback class and examples/metrics/custom_metrics_and_callbacks.py for more information.

  • on_algorithm_init – A callable or a list of callables. If a list, RLlib calls the items in the same sequence. on_algorithm_init methods overridden in callbacks_class take precedence and are called first. See on_algorithm_init() # noqa for more information.

  • on_evaluate_start – A callable or a list of callables. If a list, RLlib calls the items in the same sequence. on_evaluate_start methods overridden in callbacks_class take precedence and are called first. See on_evaluate_start() # noqa for more information.

  • on_evaluate_end – A callable or a list of callables. If a list, RLlib calls the items in the same sequence. on_evaluate_end methods overridden in callbacks_class take precedence and are called first. See on_evaluate_end() # noqa for more information.

  • on_env_runners_recreated – A callable or a list of callables. If a list, RLlib calls the items in the same sequence. on_env_runners_recreated methods overridden in callbacks_class take precedence and are called first. See on_env_runners_recreated() # noqa for more information.

  • on_checkpoint_loaded – A callable or a list of callables. If a list, RLlib calls the items in the same sequence. on_checkpoint_loaded methods overridden in callbacks_class take precedence and are called first. See on_checkpoint_loaded() # noqa for more information.

  • on_environment_created – A callable or a list of callables. If a list, RLlib calls the items in the same sequence. on_environment_created methods overridden in callbacks_class take precedence and are called first. See on_environment_created() # noqa for more information.

  • on_episode_created – A callable or a list of callables. If a list, RLlib calls the items in the same sequence. on_episode_created methods overridden in callbacks_class take precedence and are called first. See on_episode_created() # noqa for more information.

  • on_episode_start – A callable or a list of callables. If a list, RLlib calls the items in the same sequence. on_episode_start methods overridden in callbacks_class take precedence and are called first. See on_episode_start() # noqa for more information.

  • on_episode_step – A callable or a list of callables. If a list, RLlib calls the items in the same sequence. on_episode_step methods overridden in callbacks_class take precedence and are called first. See on_episode_step() # noqa for more information.

  • on_episode_end – A callable or a list of callables. If a list, RLlib calls the items in the same sequence. on_episode_end methods overridden in callbacks_class take precedence and are called first. See on_episode_end() # noqa for more information.

  • on_sample_end – A callable or a list of callables. If a list, RLlib calls the items in the same sequence. on_sample_end methods overridden in callbacks_class take precedence and are called first. See on_sample_end() # noqa for more information.

Returns:

This updated AlgorithmConfig object.