ray.rllib.algorithms.algorithm_config.AlgorithmConfig.rl_module#
- AlgorithmConfig.rl_module(*, model_config: ~typing.Dict[str, ~typing.Any] | ~ray.rllib.core.rl_module.default_model_config.DefaultModelConfig | 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>, model_config_dict=-1, _enable_rl_module_api=-1) AlgorithmConfig [source]#
Sets the config’s RLModule settings.
- Parameters:
model_config – The DefaultModelConfig object (or a config dictionary) passed as
model_config
arg into each RLModule’s constructor. This is used for all RLModules, if not otherwise specified throughrl_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 is 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 theAlgorithmConfig.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.