torchsig.datasets.default_configs.loader.get_default_yaml_config

torchsig.datasets.default_configs.loader.get_default_yaml_config(impairment_level: bool | int, train: bool, ret_config_path: bool = False) dict[source]

Loads the default YAML configuration for a given dataset type, impairment level, and training/validation status.

This function constructs the path to the appropriate YAML configuration file based on the dataset type, impairment level, and whether the dataset is for training or validation. It then loads the YAML file and returns its contents as a dictionary.

Parameters:
  • impairment_level (bool | int) – The impairment level for the dataset: - 0 or False for ‘clean’ data, - 2 or True for ‘impaired’ data.

  • train (bool) – Whether the dataset is for training (True) or validation (False).

  • ret_config_path (bool, optional) – If True, the function also returns the path to the configuration file. Defaults to False.

Returns:

The parsed dataset metadata from the YAML configuration file. If ret_config_path is True, returns a tuple of the dataset metadata and the configuration file path.

Return type:

dict

Raises:

ValueError – If the impairment level is invalid or 1.

Example

# Load the default configuration for an impaired dataset for validation and get the config path config, path = get_default_yaml_config(impairment_level=2, train=False, ret_config_path=True)