nip.parameters.base_run.BaseRunParameters#
- class nip.parameters.base_run.BaseRunParameters(base_run_type: ~typing.Literal['none', 'parameters', 'rerun_tests'] = 'none', run_id: str | None = None, wandb_project: str = <factory>, wandb_entity: str = <factory>, rerun_tests_force_test_during_training_state: bool = True)[source]#
Parameters for basing the current experiment on a previous W&B run.
- Parameters:
base_run_type (BaseRunType) – How to base the current experiment on a previous W&B run.
run_id (str, optional) – The run ID of the run to base the current experiment on. This must be provided if
base_run_type
is notBaseRunType.NONE
.wandb_project (str) – The W&B project of the run to base the current experiment on. If not provided, the default project is used.
wandb_entity (str) – The W&B entity of the run to base the current experiment on. If not provided, the default entity is used.
rerun_tests_force_test_during_training_state – When
base_run_type
is set to “rerun_tests”, if True this forces the existence of a “test_during_training” state, even when it was not present during training. Older runs did not have this state, so without this option it would be impossible to redo a run testing every iteration. Iftest_every_iteration
is not True, this option has no effect, so it’s safe to leave it as True.bool – When
base_run_type
is set to “rerun_tests”, if True this forces the existence of a “test_during_training” state, even when it was not present during training. Older runs did not have this state, so without this option it would be impossible to redo a run testing every iteration. Iftest_every_iteration
is not True, this option has no effect, so it’s safe to leave it as True.
Methods Summary
__eq__
(other)Return self==value.
__init__
([base_run_type, run_id, ...])__repr__
()Return repr(self).
_get_param_class_from_dict
(param_dict)Try to get the parameter class from a dictionary of serialised parameters.
Construct a set of basic parameters for testing.
from_dict
(params_dict[, ignore_extra_keys])Create a parameters object from a dictionary.
get
(address)Get a value from the parameters object using a dot-separated address.
to_dict
()Convert the parameters object to a dictionary.
Attributes
base_run_type
rerun_tests_force_test_during_training_state
run_id
wandb_project
wandb_entity
Methods
- __eq__(other)#
Return self==value.
- __init__(base_run_type: ~typing.Literal['none', 'parameters', 'rerun_tests'] = 'none', run_id: str | None = None, wandb_project: str = <factory>, wandb_entity: str = <factory>, rerun_tests_force_test_during_training_state: bool = True) None #
- __repr__()#
Return repr(self).
- classmethod _get_param_class_from_dict(param_dict: dict) type[ParameterValue] | None [source]#
Try to get the parameter class from a dictionary of serialised parameters.
- Parameters:
param_dict (dict) – A dictionary of parameters, which may have come from a
to_dict
method. This dictionary may contain a_type
key, which is used to determine the class of the parameter.- Returns:
param_class (type[ParameterValue] | None) – The class of the parameter, if it can be determined.
- Raises:
ValueError – If the class specified in the dictionary is not a valid parameter class.
- classmethod construct_test_params() BaseHyperParameters [source]#
Construct a set of basic parameters for testing.
- classmethod from_dict(params_dict: dict, ignore_extra_keys: bool = False) BaseHyperParameters [source]#
Create a parameters object from a dictionary.