ray.rllib.algorithms.algorithm_config.AlgorithmConfig.rl_module#

AlgorithmConfig.rl_module(*, model_config_dict: ~typing.Dict[str, ~typing.Any] | None = <ray.rllib.utils.from_config._NotProvided object>, rl_module_spec: ~ray.rllib.core.rl_module.rl_module.RLModuleSpec | ~ray.rllib.core.rl_module.multi_rl_module.MultiRLModuleSpec | None = <ray.rllib.utils.from_config._NotProvided object>, algorithm_config_overrides_per_module: ~typing.Dict[str, dict] | None = <ray.rllib.utils.from_config._NotProvided object>, _enable_rl_module_api=-1) AlgorithmConfig[source]#

Sets the config’s RLModule settings.

Parameters:
  • model_config_dict – The default model config dictionary for RLModule`s. This will be used for any `RLModule if not otherwise specified in the rl_module_spec.

  • rl_module_spec – The RLModule spec to use for this config. It can be either a RLModuleSpec or a MultiRLModuleSpec. If the observation_space, action_space, catalog_class, or the model config is not specified it will be inferred from the env and other parts of the algorithm config object.

  • algorithm_config_overrides_per_module – Only used if enable_rl_module_and_learner=True. A mapping from ModuleIDs to per-module AlgorithmConfig override dicts, which apply certain settings, e.g. the learning rate, from the main AlgorithmConfig only to this particular module (within a MultiRLModule). You can create override dicts by using the AlgorithmConfig.overrides utility. For example, to override your learning rate and (PPO) lambda setting just for a single RLModule with your MultiRLModule, do: config.multi_agent(algorithm_config_overrides_per_module={ “module_1”: PPOConfig.overrides(lr=0.0002, lambda_=0.75), })

Returns:

This updated AlgorithmConfig object.