EasyTPP Config Modules#

class easy_tpp.config_factory.Config#

Bases: Registrable

static build_from_yaml_file(yaml_dir, **kwargs)#

Load yaml config file from disk.

Parameters:

yaml_dir (str) – Path of the yaml config file.

Returns:

Config object corresponding to cls.

Return type:

EasyTPP.Config

abstractmethod copy()#

Get a same and freely modifiable copy of self.

Returns:

get(key: str, default_var: Any)#

Retrieve the key-value item from the config.

Parameters:
  • key (str) – key name.

  • default_var (Any) – default value to pop.

Returns:

value to get.

Return type:

Any

abstractmethod get_yaml_config()#

Get the yaml format config from self.

Returns:

abstractmethod static parse_from_yaml_config(yaml_config)#

Parse from the yaml to generate the config object.

Parameters:

yaml_config (dict) – configs from yaml file.

Returns:

Config class for data.

Return type:

EasyTPP.Config

pop(key: str, default_var: Any)#

pop out the key-value item from the config.

Parameters:
  • key (str) – key name.

  • default_var (Any) – default value to pop.

Returns:

value to pop.

Return type:

Any

static preset(model: str, dataset: str, stage='train', overrides: dict | list[str] | None = None, base_dir='./checkpoints/')#

Return a RunnerConfig composed from packaged data/model/trainer presets.

save_to_yaml_file(config_dir)#

Save the config into the yaml file ‘config_dir’.

Parameters:

config_dir (str) – Target filename.

Returns:

set(key: str, var_to_set: Any)#

Set the key-value item from the config.

Parameters:
  • key (str) – key name.

  • var_to_set (Any) – default value to pop.

Returns:

value to get.

Return type:

Any

update(config)#

Update the config.

Parameters:

config (dict) – config dict.

Returns:

Config class for data.

Return type:

EasyTPP.Config

easy_tpp.config_factory.apply_overrides(config_dict, dotlist)#

Return a fresh plain dictionary merged with OmegaConf CLI overrides.

class easy_tpp.config_factory.DataConfig(train_dir=None, valid_dir=None, test_dir=None, data_format=None, specs=None, **kwargs)#

Bases: Config

copy()#

Get a same and freely modifiable copy of self.

Returns:

get_data_dir(split)#

Get the dir of the source raw data.

Parameters:

split (str) – dataset split notation, ‘train’, ‘dev’ or ‘valid’, ‘test’.

Returns:

dir of the source raw data file.

Return type:

str

get_yaml_config()#

Return the config in dict (yaml compatible) format.

Returns:

config of the data in dict format.

Return type:

dict

static parse_from_yaml_config(yaml_config)#

Parse from the yaml to generate the config object.

Parameters:

yaml_config (dict) – configs from yaml file.

Returns:

Config class for data.

Return type:

EasyTPP.DataConfig

class easy_tpp.config_factory.DataSpecConfig(**kwargs)#

Bases: Config

copy()#

Get a same and freely modifiable copy of self.

Returns:

get_yaml_config()#

Return the config in dict (yaml compatible) format.

Returns:

config of the data specs in dict format.

Return type:

dict

static parse_from_yaml_config(yaml_config)#

Parse from the yaml to generate the config object.

Parameters:

yaml_config (dict) – configs from yaml file.

Returns:

Config class for data specs.

Return type:

DataSpecConfig

class easy_tpp.config_factory.ModelConfig(**kwargs)#

Bases: Config

copy()#

Get a same and freely modifiable copy of self.

Returns:

get_yaml_config()#

Return the config in dict (yaml compatible) format.

Returns:

config of the model config specs in dict format.

Return type:

dict

static parse_from_yaml_config(yaml_config)#

Parse from the yaml to generate the config object.

Parameters:

yaml_config (dict) – configs from yaml file.

Returns:

Config class for trainer specs.

Return type:

ModelConfig

class easy_tpp.config_factory.BaseConfig(**kwargs)#

Bases: Config

copy()#

Copy the config.

Returns:

a copy of current config.

Return type:

BaseConfig

get_yaml_config()#

Return the config in dict (yaml compatible) format.

Returns:

config of the base config specs in dict format.

Return type:

dict

static parse_from_yaml_config(yaml_config)#

Parse from the yaml to generate the config object.

Parameters:

yaml_config (dict) – configs from yaml file.

Returns:

Config class for trainer specs.

Return type:

BaseConfig

static set_backend(backend)#
class easy_tpp.config_factory.RunnerConfig(base_config, model_config, data_config, trainer_config)#

Bases: Config

copy()#

Copy the config.

Returns:

a copy of current config.

Return type:

RunnerConfig

get_metric_direction(metric_name='rmse')#
get_metric_functions()#
get_yaml_config()#

Return the config in dict (yaml compatible) format.

Returns:

config of the runner config in dict format.

Return type:

dict

static parse_from_yaml_config(yaml_config, **kwargs)#

Parse from the yaml to generate the config object.

Parameters:

yaml_config (dict) – configs from yaml file.

Returns:

Config class for trainer specs.

Return type:

RunnerConfig

update_config()#

Updated config dict.

class easy_tpp.config_factory.HPOConfig(framework_id=None, storage_uri=None, is_continuous=None, num_trials=None, num_jobs=None, **kwargs)#

Bases: Config

copy()#

Copy the config.

Returns:

a copy of current config.

Return type:

EasyTPP.HPOConfig

get_yaml_config()#

Return the config in dict (yaml compatible) format.

Returns:

config of the HPO specs in dict format.

Return type:

dict

static parse_from_yaml_config(yaml_config, **kwargs)#

Parse from the yaml to generate the config object.

Parameters:

yaml_config (dict) – configs from yaml file.

Returns:

Config class for HPO specs.

Return type:

EasyTPP.HPOConfig

property storage_path#

Get the storage protocol

Returns:

the dir of the hpo data storage.

Return type:

str

property storage_protocol#

Get the storage protocol

Returns:

the dir of the storage protocol.

Return type:

str

class easy_tpp.config_factory.HPORunnerConfig(hpo_config, runner_config)#

Bases: Config

copy()#

Copy the config.

Returns:

a copy of current config.

Return type:

EasyTPP.HPORunnerConfig

static parse_from_yaml_config(yaml_config, **kwargs)#

Parse from the yaml to generate the config object.

Parameters:

yaml_config (dict) – configs from yaml file.

Returns:

Config class for HPO specs.

Return type:

EasyTPP.HPORunnerConfig