rllib/agents/trainer_config.py
def to_dict(self) -> TrainerConfigDict:
        """Converts all settings into a legacy config dict for backward compatibility.

        Returns:
            A complete TrainerConfigDict, usable in backward-compatible Tune/RLlib
            use cases, e.g. w/ `tune.run()`.
        """
        config = copy.deepcopy(vars(self))
        config.pop("trainer_class")

        # Worst naming convention ever: NEVER EVER use reserved key-words...
        if "lambda_" in config:
            assert hasattr(self, "lambda_")
            config["lambda"] = getattr(self, "lambda_")
            config.pop("lambda_")
        if "input_" in config:
            assert hasattr(self, "input_")
            config["input"] = getattr(self, "input_")
            config.pop("input_")

        # Switch out deprecated vs new config keys.
        config["callbacks"] = config.pop("callbacks_class", DefaultCallbacks)
        config["create_env_on_driver"] = config.pop("create_env_on_local_worker", 1)
        config["custom_eval_function"] = config.pop("custom_evaluation_function", None)
        config["framework"] = config.pop("framework_str", None)
        config["num_cpus_for_driver"] = config.pop("num_cpus_for_local_worker", 1)

        # Get our Trainer class' default config.
        from ray.rllib.agents.trainer import Trainer, COMMON_CONFIG

        # Add our overrides to the default config.
        return Trainer.merge_trainer_configs(
            COMMON_CONFIG, config, _allow_unknown_configs=True
        )
Converts all settings into a legacy config dict for backward compatibility.

        Returns:
            A complete TrainerConfigDict, usable in backward-compatible Tune/RLlib
            use cases, e.g. w/ `tune.run()`.
        
Converts all settings into a legacy config dict for backward compatibility.
Converts all settings into a legacy config dict for backward compatibility .
def to_dict(self) -> TrainerConfigDict:
        config = copy.deepcopy(vars(self))
        config.pop("trainer_class")
        if "lambda_" in config:
            assert hasattr(self, "lambda_")
            config["lambda"] = getattr(self, "lambda_")
            config.pop("lambda_")
        if "input_" in config:
            assert hasattr(self, "input_")
            config["input"] = getattr(self, "input_")
            config.pop("input_")
        config["callbacks"] = config.pop("callbacks_class", DefaultCallbacks)
        config["create_env_on_driver"] = config.pop("create_env_on_local_worker", 1)
        config["custom_eval_function"] = config.pop("custom_evaluation_function", None)
        config["framework"] = config.pop("framework_str", None)
        config["num_cpus_for_driver"] = config.pop("num_cpus_for_local_worker", 1)
        from ray.rllib.agents.trainer import Trainer, COMMON_CONFIG
        return Trainer.merge_trainer_configs(
            COMMON_CONFIG, config, _allow_unknown_configs=True
        )
def to_dict ( self ) -> TrainerConfigDict : config = copy . deepcopy ( vars ( self ) ) config . pop ( "trainer_class" ) if "lambda_" in config : assert hasattr ( self , "lambda_" ) config [ "lambda" ] = getattr ( self , "lambda_" ) config . pop ( "lambda_" ) if "input_" in config : assert hasattr ( self , "input_" ) config [ "input" ] = getattr ( self , "input_" ) config . pop ( "input_" ) config [ "callbacks" ] = config . pop ( "callbacks_class" , DefaultCallbacks ) config [ "create_env_on_driver" ] = config . pop ( "create_env_on_local_worker" , 1 ) config [ "custom_eval_function" ] = config . pop ( "custom_evaluation_function" , None ) config [ "framework" ] = config . pop ( "framework_str" , None ) config [ "num_cpus_for_driver" ] = config . pop ( "num_cpus_for_local_worker" , 1 ) from ray . rllib . agents . trainer import Trainer , COMMON_CONFIG return Trainer . merge_trainer_configs ( COMMON_CONFIG , config , _allow_unknown_configs = True )
Converts all settings into a legacy config dict for backward compatibility.
Converts all settings into a legacy config dict for backward compatibility .
"""Converts all settings into a legacy config dict for backward compatibility.

        Returns:
            A complete TrainerConfigDict, usable in backward-compatible Tune/RLlib
            use cases, e.g. w/ `tune.run()`.
        """ # Worst naming convention ever: NEVER EVER use reserved key-words... # Switch out deprecated vs new config keys. # Get our Trainer class' default config. # Add our overrides to the default config.
A complete TrainerConfigDict, usable in backward-compatible Tune/RLlib
use cases, e.g.
A complete TrainerConfigDict usable in backward - compatible Tune / RLlib use cases e . g .
self