TorchDSP / torchsig

TorchSig is an open-source signal processing machine learning toolkit based on the PyTorch data handling pipeline.
MIT License
170 stars 38 forks source link

Online data generation and training #161

Closed biasedlearner closed 1 year ago

biasedlearner commented 1 year ago

Is there an example script that does online data generation on the fly and training on it rather than first creating data, saving in memory, and using that for training? Is it possible to share how you experimented with the RadioML2018 dataset?

gvanhoy commented 1 year ago

Hm, not just a plain example for that, but a few pieces of the code will get you there like:

from torchsig.datasets.modulations import ModulationsDataset
from torchsig.datasets import conf

config = conf.Sig53CleanTrainConfig
dataset = ModulationsDataset(
    level=config.level,
    num_samples=config.num_samples,
    num_iq_samples=config.num_iq_samples,
    use_class_idx=config.use_class_idx,
    include_snr=config.include_snr,
    eb_no=config.eb_no,
)
# at this point, you can get data with dataset[index] or wrap the dataset in a data loader.

Would an example beyond this be helpful?

biasedlearner commented 1 year ago

Thank you for the reply. Yes, an example beyond this would be a great help 😊

gvanhoy commented 1 year ago

More examples to come, but you can find this in the examples folder in the v0.4.2 branch. Here's a direct link.