torchsig.utils.generate.generate

torchsig.utils.generate.generate(root: str, dataset_metadata: DatasetMetadata, batch_size: int, num_workers: int)[source]

Generates and saves a dataset to disk.

This function selects the dataset type (‘narrowband’ or ‘wideband’) based on the provided metadata and then calls the DatasetCreator class to generate the dataset and save it to disk. It writes the dataset in batches using the specified batch size and number of workers.

Parameters:
  • root (str) – The root directory where the dataset will be saved.

  • dataset_metadata (DatasetMetadata) – Metadata that defines the dataset type and properties.

  • batch_size (int) – The number of samples per batch to process.

  • num_workers (int) – The number of worker threads to use for loading the data in parallel.

Raises:

ValueError – If the dataset type is unknown or invalid.