ngclearn.components.input_encoders package
Submodules
ngclearn.components.input_encoders.bernoulliCell module
- class ngclearn.components.input_encoders.bernoulliCell.BernoulliCell(*args, **kwargs)[source]
Bases:
JaxComponentA Bernoulli cell that produces spikes by sampling a Bernoulli distribution on-the-fly (to produce data-scaled Bernoulli spike trains).
— Cell Input Compartments: —inputs - input (takes in external signals – should be probabilities w/ values in [0,1])— Cell State Compartments: —key - JAX PRNG key— Cell Output Compartments: —outputs - outputtols - time-of-last-spike- Parameters:
name – the string name of this cell
n_units – number of cellular entities (neural population size)
batch_size – batch size dimension of this cell (Default: 1)
ngclearn.components.input_encoders.latencyCell module
- class ngclearn.components.input_encoders.latencyCell.LatencyCell(*args, **kwargs)[source]
Bases:
JaxComponentA (nonlinear) latency encoding (spike) cell; produces a time-lagged set of spikes on-the-fly.
— Cell Input Compartments: —inputs - input (takes in external signals)— Cell State Compartments: —targ_sp_times - target-spike-timemask - spike-ordering maskkey - JAX PRNG key— Cell Output Compartments: —outputs - outputtols - time-of-last-spike- Parameters:
name – the string name of this cell
n_units – number of cellular entities (neural population size)
tau – time constant for model used to calculate firing time (Default: 1 ms)
threshold – sensory input features below this threhold value will fire at final step in time of this latency coded spike train
first_spike_time – time of first allowable spike (ms) (Default: 0 ms)
linearize – should the linear latency encoding scheme be used? (otherwise, defaults to logarithmic latency encoding)
normalize –
normalize the latency code such that final spike(s) occur a pre-specified number of simulation steps “num_steps”? (Default: False)
- Note:
if this set to True, you will need to choose a useful value for the “num_steps” argument (>1), depending on how many steps simulated
clip_spikes – should values under threshold be removed/suppressed? (default: False)
num_steps – number of discrete time steps to consider for normalized latency code (only useful if “normalize” is set to True) (Default: 1)
batch_size – batch size dimension of this cell (Default: 1)
ngclearn.components.input_encoders.phasorCell module
- class ngclearn.components.input_encoders.phasorCell.PhasorCell(*args, **kwargs)[source]
Bases:
JaxComponentA phasor cell that emits a pulse at a regular interval.
— Cell Input Compartments: —inputs - input (takes in external signals)— Cell State Compartments: —key - JAX PRNG keyangles - current angle of phasor— Cell Output Compartments: —outputs - output of phasor celltols - time-of-last-spike- Parameters:
name – the string name of this cell
n_units – number of cellular entities (neural population size)
target_freq – maximum frequency (in Hertz) of this spike train (must be > 0.)
batch_size – batch size dimension of this cell (Default: 1)
ngclearn.components.input_encoders.poissonCell module
- class ngclearn.components.input_encoders.poissonCell.PoissonCell(*args, **kwargs)[source]
Bases:
JaxComponentA Poisson cell that samples a homogeneous Poisson process on-the-fly to produce a spike train.
— Cell Input Compartments: —inputs - input (takes in external signals)— Cell State Compartments: —key - JAX PRNG key— Cell Output Compartments: —outputs - outputtols - time-of-last-spike- Parameters:
name – the string name of this cell
n_units – number of cellular entities (neural population size)
target_freq – maximum frequency (in Hertz) of this Bernoulli spike train (must be > 0.)
batch_size – batch size dimension of this cell (Default: 1)