PopulationEncoder

PopulationEncoder#

class braintools.PopulationEncoder(n_neurons, min_val=0.0, max_val=1.0, sigma=None, max_rate=100.0)#

Encode scalar values using population coding.

Each input value is encoded by a population of neurons with overlapping receptive fields. The population response forms a bell curve centered on the input value.

Example:

>>> encoder = PopulationEncoder(n_neurons=10, min_val=0, max_val=1)
>>> spikes = encoder(0.5, n_time=100)  # Should peak at neuron 5
Parameters:
  • n_neurons (int) – int. Number of neurons in the population.

  • min_val (float) – float. Minimum input value.

  • max_val (float) – float. Maximum input value.

  • sigma (float) – float. Width of receptive fields (standard deviation).

  • max_rate (float) – float. Maximum firing rate of neurons.