torchsig.datasets.datasets.TorchsigIterableDataset¶
- class torchsig.datasets.datasets.TorchsigIterableDataset(dataset_metadata: DatasetMetadata | str | dict, **kwargs)[source]¶
Bases:
IterableDataset,SeedableCreates a new TorchSig dataset that generates data infinitely unless num_samples inside dataset_metadata is defined.
This base class provides the functionality to generate signals and write them to disk if necessary. The dataset will continue to generate samples infinitely unless a num_samples value is defined in the dataset_metadata.
Methods
Add parent Seedable object and set up RNGs accordingly
get_distributionGets second seed, usually used to seed both torch and numpy generators with slightly different seeds
Resets the dataset to its initial state.
Seed number generators with given seed.
Initialize torch and numpy number generators, and update its children.
Update numpy and torch number generators with parent seed
Attributes
Returns the dataset metadata.
- __init__(dataset_metadata: DatasetMetadata | str | dict, **kwargs)[source]¶
Initializes the dataset, creates signal builders, and prepares file handlers based on metadata.
- Parameters:
dataset_metadata (DatasetMetadata | str | dict) – The dataset metadata.
**kwargs – Additional keyword arguments for initialization.
- __str__() str[source]¶
Returns a string representation of the dataset, including its metadata and the signal builders.
- Returns:
String representation of the dataset.
- Return type:
- __repr__()[source]¶
Returns a string representation of the object with all its attributes.
- Returns:
String representation of the object with its attributes.
- Return type:
- property dataset_metadata¶
Returns the dataset metadata.
- Returns:
The dataset metadata.
- Return type: