dp icon indicating copy to clipboard operation
dp copied to clipboard

Randomly generated data as the data source

Open eulerreich opened this issue 9 years ago • 1 comments

Currently, if I want to randomly generate sequences of bits as input and some transform of these sequences as output, I'd have to do this all at once before training, for a fixed number of samples, to make a data source. Is there a way to generate these data on the fly, as the model is requesting them?

eulerreich avatar Sep 20 '15 23:09 eulerreich

@eulerreich Yes, you could implement a DataSet subclass that does this for you. Just over-write the sub(), index() or sample() method. These work respectively with the Sampler, ShuffleSampler and RandomSampler samplers.

nicholas-leonard avatar Sep 21 '15 15:09 nicholas-leonard