theanets.recurrent.batches

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

Create a callable that generates samples from a dataset.

Parameters:

arrays : list of ndarray (time-steps, data-dimensions)

Arrays of data. Rows in these arrays are assumed to correspond to time steps, and columns to variables. Multiple arrays can be given; in such a case, these arrays usually correspond to [input, output]—for example, for a recurrent regression problem—or [input, output, weights]—for a weighted regression or classification problem.

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.