This class does the basic sanity check of input_config. More...
Public Member Functions | |
def | __init__ (self, Dict[str, Any] input_config) |
None | check_activation_init_sanity (self) |
Checks the basic sanity of activation related arguments in config. More... | |
None | check_agent_init_sanity (self, bool only_model_arg_check=False) |
Check the sanity of agent input. More... | |
bool | check_distribution_sanity (self) |
For agents with requirements of the argument distribution , checks if valid distribution is being passed. More... | |
None | check_if_valid_agent_for_simulator (self) |
Checks if agent is valid for rlpack.simulator.Simulator (single process agent). More... | |
None | check_if_valid_agent_for_simulator_distributed (self) |
Checks if agent is valid for rlpack.simulator_distributed.SimulatorDistributed (multi process agent). More... | |
None | check_lr_scheduler_init_sanity (self) |
Checks the basic sanity of lr_scheduler related arguments in config. More... | |
None | check_mandatory_params_sanity (self) |
Checks the sanity of mandatory parameters for RLPack Simulator to run. More... | |
bool | check_model_init_sanity (self) |
Checks the sanity of model arguments, either custom or in-built. More... | |
None | check_optimizer_init_sanity (self) |
Checks the basic sanity of optimizer related arguments in config. More... | |
def | __init__ (self) |
Data Fields | |
args | |
The arguments received from the input input_config keyword arguments. More... | |
input_config | |
The argument input_config ; indicating keyword arguments to be used to training/evaluation. More... | |
![]() | |
activation_init_args | |
The activation initialization arguments when using in-built models. More... | |
activation_map | |
The mapping between given keyword and PyTorch activation function class. More... | |
agent_args | |
The mapping between given keyword and agent agents' arguments. More... | |
agent_args_default | |
The mapping between given keyword and agent agent's default arguments. More... | |
agent_init_args | |
The mandatory agent initialisation arguments. More... | |
agents | |
The mapping between given keyword and agents models. More... | |
distributions_map | |
The mapping between given keyword and PyTorch Distribution class. More... | |
loss_function_map | |
The mapping between given keyword and PyTorch loss function class. More... | |
lr_scheduler_init_args | |
The LR Scheduler initialization arguments. More... | |
lr_scheduler_map | |
The mapping between given keyword and PyTorch LR Scheduler class. More... | |
mandatory_distributed_agents | |
mandatory_distribution_required_agents | |
mandatory_keys | |
The tuple for mandatory keys (or keyword arguments) always expected. More... | |
model_args | |
The mapping between given keyword and in-built models' arguments. More... | |
model_args_default | |
The mapping between given keyword and in-built model's default arguments. More... | |
model_args_to_optimize | |
The mapping between keyword and agents' model arguments to wrap optimizer with. More... | |
model_init_args | |
The model initialization arguments when using in-built models. More... | |
models | |
The mapping between given keyword and in-built models. More... | |
optimizer_init_args | |
The optimizer initialization arguments for given models. More... | |
optimizer_map | |
The mapping between given keyword and PyTorch optimizer class. More... | |
Private Member Functions | |
str | _error_message (self, str param_of_arg, List[bool] boolean_args) |
Protected method to craft the error message indicating parameters that are missing. More... | |
Additional Inherited Members | |
![]() | |
def | get_prefix_path () |
Gets prefix path for rlpack package, from python installation. More... | |
This class does the basic sanity check of input_config.
def rlpack.utils.sanity_check.SanityCheck.__init__ | ( | self, | |
Dict[str, Any] | input_config | ||
) |
input_config | (Dict[str, Any]): The input config that is to be used for training/evaluation. |
Reimplemented from rlpack.utils.base.register.Register.
|
private |
Protected method to craft the error message indicating parameters that are missing.
param_of_arg | str: The parameter for which argument is missing. |
boolean_args | Boolean list of indicating if the corresponding argument was received or not |
None rlpack.utils.sanity_check.SanityCheck.check_activation_init_sanity | ( | self | ) |
Checks the basic sanity of activation related arguments in config.
Note that this will not check sanity of the given activation even if Activation is valid. If invalid arguments are passed, error will be raised by PyTorch.
None rlpack.utils.sanity_check.SanityCheck.check_agent_init_sanity | ( | self, | |
bool | only_model_arg_check = False |
||
) |
Check the sanity of agent input.
This function will check the arguments received for agents to verify if all necessary arguments are received.
only_model_arg_check | bool: Indicating weather to check only the model related arguments or all of the mandatory arguments. |
bool rlpack.utils.sanity_check.SanityCheck.check_distribution_sanity | ( | self | ) |
For agents with requirements of the argument distribution
, checks if valid distribution is being passed.
If agent requires distribution argument and valid argument is passed, True is returned. If agent doesn't require distribution argument returns False.
distribution
argument or not. None rlpack.utils.sanity_check.SanityCheck.check_if_valid_agent_for_simulator | ( | self | ) |
Checks if agent is valid for rlpack.simulator.Simulator (single process agent).
None rlpack.utils.sanity_check.SanityCheck.check_if_valid_agent_for_simulator_distributed | ( | self | ) |
Checks if agent is valid for rlpack.simulator_distributed.SimulatorDistributed (multi process agent).
None rlpack.utils.sanity_check.SanityCheck.check_lr_scheduler_init_sanity | ( | self | ) |
Checks the basic sanity of lr_scheduler related arguments in config.
Note that this will not check sanity of the given lr_scheduler's args even if LR Scheduler valid. If invalid arguments are passed, error will be raised by PyTorch.
None rlpack.utils.sanity_check.SanityCheck.check_mandatory_params_sanity | ( | self | ) |
Checks the sanity of mandatory parameters for RLPack Simulator to run.
bool rlpack.utils.sanity_check.SanityCheck.check_model_init_sanity | ( | self | ) |
Checks the sanity of model arguments, either custom or in-built.
When in-built is to be used, both model_name
and model_args
must be passed. If both are not passed, it will try to check if there is a custom model that is passed. Custom models' names must correspond to their target agent's keyword argument name.
None rlpack.utils.sanity_check.SanityCheck.check_optimizer_init_sanity | ( | self | ) |
Checks the basic sanity of optimizer related arguments in config.
Note that this will not check sanity of the given optimizer args even if optimizer is valid. If invalid arguments are passed, error will be raised by PyTorch.
rlpack.utils.sanity_check.SanityCheck.args |
The arguments received from the input input_config
keyword arguments.
rlpack.utils.sanity_check.SanityCheck.input_config |
The argument input_config
; indicating keyword arguments to be used to training/evaluation.