StepCurrentEncoder#
- class braintools.StepCurrentEncoder(current_scale=10.0, offset=0.0, normalize=True, min_val=None, max_val=None)#
Encode inputs as step current injections for LIF neurons.
Converts input values to constant current levels that can be injected into integrate-and-fire neurons. The current amplitude determines the firing rate of the neuron.
Example:
>>> encoder = StepCurrentEncoder(current_scale=10.0) >>> currents = encoder(jnp.array([0.1, 0.5, 1.0]), n_time=100) >>> # Returns current levels [1.0, 5.0, 10.0] nA
- Parameters:
current_scale (
float) – float. Scaling factor to convert inputs to current (nA).offset (
float) – float. Baseline current offset.normalize (
bool) – bool. Whether to normalize inputs.min_val (
float|None) – float. Minimum value for normalization.max_val (
float|None) – float. Maximum value for normalization.