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