Skip to content

Make generated WidebandModulationsDataset samples independent of call order #250

Closed
@dustinlagoy

Description

@dustinlagoy

First, thanks for all the work on this project. It is a great resource!!!

Is your feature request related to a problem? Please describe.
If I use the WidebandModulationsDataset to generate samples without using a DataLoader (or DatasetLoader) the samples depend on the order in which they are generated. For example:

data = WidebandModulationsDataset(...)
assert data[0] == data[0]

will fail because the generated sample at index 0 (or any index) changes each time you call data[0]. Both the number and characteristics of the generated signals and the added noise change on each subsequent call. This makes using on-the-fly generation of samples difficult unless one can ensure they are always generated in the same order.

Describe the solution you'd like
I think the dataset should generate the exact same sample for a given index regardless of any previous sample generation.

Describe alternatives you've considered
When generating samples to be written to disk, or training with on-the-fly generation of samples the data loader may ensure (it does at least for writing samples to disk) that the order of calls to WidebandModulationsDataset.__getitem__ are consistent and work around this issue. This may be sufficient for all practical use cases.

Additional context
I opened a pull request (#249) with sufficient changes to fix this issue. I understand if this feature is not desirable. In that case it may be nice to make this behavior clear in the documentation somewhere.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: featureNew feature or enhancement

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions