Config

Configuration specifications to automatically generate a config file and allow correct use.

Includes the config class, its default parameters and directly related factories.

class ecgan.config.configs.Config(base_config='config.yml', output_file='config.yml')[source]

Bases: abc.ABC

Base class for configurations which can be used to generate persistent config files or read from one.

generate_config_file()[source]

Generate a default configuration file with dummy values.

class ecgan.config.configs.PreprocessingConfigFactory[source]

Bases: object

Factory for preprocessing configs.

static choose_class(dataset)[source]

Choose the correct class based on the provided dataset name.

Return type

Type[PreprocessingConfig]

class ecgan.config.configs.TrainConfig(base_config='config.yml', output_file='config.yml')[source]

Bases: ecgan.config.configs.Config

Create a config object.

Creates config no base_config has yet been created.

class ecgan.config.configs.InverseConfig(base_config='config.yml', output_file='config.yml')[source]

Bases: ecgan.config.configs.Config

Configuration for an inverse mapping.

Attribs

alias of ecgan.config.nested_dataclass.nested_dataclass.<locals>.wrapper.<locals>.NestedDataclass

class ecgan.config.configs.AnomalyDetectionConfig(base_config='ad_config.yml', output_file='ad_config.yml')[source]

Bases: ecgan.config.configs.Config

Configuration used to detect anomalies.

static configure(entity, project, name, run_path, fold, run_version='latest', save_locally=False, save_pdf=False, s3_checkpoint_upload=False, log_level='info')[source]

Return the default configuration for the anomaly detection.

Return type

Dict

class ecgan.config.configs.DetectionConfigFactory[source]

Bases: object

Create an instance of ModuleConfig depending on the provided module.

static choose_class(detector)[source]

Choose the correct class based on the provided module name.

Return type

Type[DetectionConfig]

class ecgan.config.configs.ModuleConfigFactory[source]

Bases: object

Create an instance of ModuleConfig depending on the provided module.

static choose_class(module)[source]

Choose the correct class based on the provided module name.

Return type

Type[NestedDataclass]

Helper function to access configurations from previous runs.

ecgan.config.helpers.get_run_config(config)[source]

Return a TrainerConfig from a InverseConfig.Attribs or AnomalyDetectionConfig.

Return type

TrainConfig

ecgan.config.helpers.get_inv_run_config(ad_config)[source]

Retrieve inverse config.

Return type

InverseConfig

ecgan.config.helpers.get_model_path(run_uri, run_version)[source]

Return a model path from a run URI and a version.

Return type

str

ecgan.config.helpers.get_(val, default)[source]

Retrieve values from typed dict or set a default if None.

Return type

~T