theanets.recurrent.batches

theanets.recurrent.batches(samples, labels=None, steps=100, batch_size=64, rng=None)

Return a callable that generates samples from a dataset.

Parameters:

samples : ndarray (time-steps, data-dimensions)

An array of data. Rows in this array correspond to time steps, and columns to variables.

labels : ndarray (time-steps, label-dimensions), optional

An array of data. Rows in this array correspond to time steps, and columns to labels.

steps : int, optional

Generate samples of this many time steps. Defaults to 100.

batch_size : int, optional

Generate this many samples per call. Defaults to 64. This must match the batch_size parameter that was used when creating the recurrent network that will process the data.

rng : numpy.random.RandomState or int, optional

A random number generator, or an integer seed for a random number generator. If not provided, the random number generator will be created with an automatically chosen seed.

Returns:

callable :

A callable that can be used inside a dataset for training a recurrent network.