spyx.data#

Module Contents#

Functions#

shift_augment([max_shift, axes])

Shift data augmentation tool. Rolls data along specified axes randomly up to a certain amount.

shuffler(dataset, batch_size)

Higher-order-function which builds a shuffle function for a dataset.

rate_code(num_steps[, max_r])

Unrolls input data along axis 1 and converts to rate encoded spikes; the probability of spiking is based on the input value multiplied by a max rate, with each time step being a sample drawn from a Bernoulli distribution.

angle_code(neuron_count, min_val, max_val)

Higher-order-function which returns an angle encoding function; given a continuous value, an angle converter generates a one-hot vector corresponding to where the value falls between a specified minimum and maximum.

spyx.data.shift_augment(max_shift=10, axes=(-1,))[source]#

Shift data augmentation tool. Rolls data along specified axes randomly up to a certain amount.

Max_shift:

maximum to which values can be shifted.

Axes:

the data axis or axes along which the input will be randomly shifted.

spyx.data.shuffler(dataset, batch_size)[source]#

Higher-order-function which builds a shuffle function for a dataset.

Dataset:

jnp.array [# samples, time, channels…]

Batch_size:

desired batch size.

spyx.data.rate_code(num_steps, max_r=0.75)[source]#

Unrolls input data along axis 1 and converts to rate encoded spikes; the probability of spiking is based on the input value multiplied by a max rate, with each time step being a sample drawn from a Bernoulli distribution. Currently Assumes input values have been rescaled to between 0 and 1.

spyx.data.angle_code(neuron_count, min_val, max_val)[source]#

Higher-order-function which returns an angle encoding function; given a continuous value, an angle converter generates a one-hot vector corresponding to where the value falls between a specified minimum and maximum. To achieve non-linear descritization, apply a function to the continuous value before feeding it into the encoder.

Neuron_count:

The number of output channels for the angle encoder

Min_val:

A lower bound on the continuous input channel

Max_val:

An upper bound on the continuous input channel.