WeightedPhaseEncoder#

class brainpy.encoding.WeightedPhaseEncoder(min_val, max_val, num_phase, weight_fun=None)[source]#

Encode the rate input into the spike train according to [1].

The main idea of the weighted spikes is assigning different weights to different phases (or to spikes in those phases) in order to pack more information into the spikes. This is the major difference from a conventional rate coding scheme that assigns the same weight to every spike [1].

Parameters:
  • min_val (float) – The minimal value in the given data x, used to the data normalization.

  • max_val (float) – The maximum value in the given data x, used to the data normalization.

  • num_phase (int) – The number of the encoding period.

  • weight_fun (Callable) – The function to generate weight at the phase \(i\).

References