torchsig.datasets.narrowband.NewNarrowband¶
- class torchsig.datasets.narrowband.NewNarrowband(dataset_metadata: DatasetMetadata | str | dict, **kwargs)[source]¶
Bases:
NewTorchSigDatasetCreates a Narrowband dataset.
This class is responsible for creating the Narrowband dataset, which includes the dataset metadata and signal impairments.
- Parameters:
dataset_metadata (DatasetMetadata | str | dict) – Metadata for the Narrowband dataset. This can be a DatasetMetadata object, a string (path to the metadata file), or a dictionary.
**kwargs – Additional keyword arguments passed to the parent class (NewTorchSigDataset).
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 Narrowband dataset.
- Parameters:
dataset_metadata (NarrowbandMetadata) – The metadata specific to the Narrowband dataset.
- __repr__()¶
Returns a string representation of the object with all its attributes.
- Returns:
String representation of the object with its attributes.
- Return type:
- __str__() str¶
Returns a string representation of the dataset, including its metadata and the signal builders.
- Returns:
String representation of the dataset.
- Return type:
- property dataset_metadata¶
Returns the dataset metadata.
- Returns:
The dataset metadata.
- Return type:
- get_second_seed(seed: int) int¶
Gets second seed, usually used to seed both torch and numpy generators with slightly different seeds
- reset()¶
Resets the dataset to its initial state.