torchsig.datasets.dataset_utils.to_dataset_metadata¶
- torchsig.datasets.dataset_utils.to_dataset_metadata(dataset_metadata: DatasetMetadata | str | dict)[source]¶
Converts the input dataset metadata to an appropriate DatasetMetadata object.
- Parameters:
dataset_metadata (DatasetMetadata | str | dict) – The dataset metadata, which can be: - A DatasetMetadata object, - A string representing the path to a YAML file containing the metadata, - A dictionary representing the dataset metadata.
- Returns:
The corresponding NarrowbandMetadata or WidebandMetadata object initialized with the provided parameters.
- Return type:
- Raises:
ValueError – If the input dataset_metadata is not valid or if required fields are missing from the metadata.