norse.torch.functional.encode

norse.torch.functional.encode#

Stateless encoding functionality for Norse, offering different ways to convert numerical inputs to the spiking domain. Note that some functions, like population_encode does not return spikes, but rather numerical values that will have to be converted into spikes via, for instance, the poisson encoder.

Functions

constant_current_lif_encode(input_current, ...)

Encodes input currents as fixed (constant) voltage currents, and simulates the spikes that occur during a number of timesteps/iterations (seq_length).

euclidean_distance(x, y)

Simple euclidean distance metric.

gaussian_rbf(tensor[, sigma])

A gaussian radial basis kernel that calculates the radial basis given a distance value (distance between \(x\) and a data value \(x'\), or \(\|\mathbf{x} - \mathbf{x'}\|^2\) below).

poisson_encode(input_values, seq_length[, ...])

Encodes a tensor of input values, which are assumed to be in the range [0,1] into a tensor of one dimension higher of binary values, which represent input spikes.

poisson_encode_step(input_values[, f_max, ...])

Encodes a tensor of input values, which are assumed to be in the range [0,1] into a tensor of binary values, which represent input spikes.

population_encode(input_values, out_features)

Encodes a set of input values into population codes, such that each singular input value is represented by a list of numbers (typically calculated by a radial basis kernel), whose length is equal to the out_features.

signed_poisson_encode(input_values, seq_length)

Encodes a tensor of input values, which are assumed to be in the range [-1,1] into a tensor of one dimension higher of binary values, which represent input spikes.

signed_poisson_encode_step(input_values[, ...])

Creates a poisson distributed signed spike vector, when

spike_latency_encode(input_spikes)

For all neurons, remove all but the first spike.

spike_latency_lif_encode(input_current, ...)

Encodes an input value by the time the first spike occurs.