Izhikevich#

class brainpy.state.Izhikevich(in_size, a=Quantity(0.02, "kHz"), b=Quantity(0.2, "kHz"), c=Quantity(-65., "mV"), d=Quantity(8., "mV / ms"), V_th=Quantity(30., "mV"), V_initializer=Constant(value=-65. mV), u_initializer=Constant(value=0. mV / ms), spk_fun=ReluGrad(alpha=0.3, width=1.0), spk_reset='hard', name=None)#

Izhikevich neuron model.

This class implements the Izhikevich neuron model, a two-dimensional spiking neuron model that can reproduce a wide variety of neuronal firing patterns observed in biological neurons. The model combines computational efficiency with biological plausibility through a quadratic voltage dynamics and a linear recovery variable.

The model is characterized by the following differential equations:

\[ \frac{dV}{dt} = 0.04 V^2 + 5V + 140 - u + I(t) \]

\[ \frac{du}{dt} = a(bV - u) \]

Spike condition: If \(V \geq V_{th}\): emit spike, set \(V = c\) and \(u = u + d\)

Parameters:
  • in_size (Size) – Size of the input to the neuron.

  • a (ArrayLike, default 0.02 / u.ms) – Time scale of the recovery variable u. Smaller values result in slower recovery.

  • b (ArrayLike, default 0.2 / u.ms) – Sensitivity of the recovery variable u to the membrane potential V.

  • c (ArrayLike, default -65. * u.mV) – After-spike reset value of the membrane potential.

  • d (ArrayLike, default 8. * u.mV / u.ms) – After-spike increment of the recovery variable u.

  • V_th (ArrayLike, default 30. * u.mV) – Spike threshold voltage.

  • V_initializer (Callable) – Initializer for the membrane potential state.

  • u_initializer (Callable) – Initializer for the recovery variable state.

  • spk_fun (Callable, default surrogate.ReluGrad()) – Surrogate gradient function for the non-differentiable spike generation.

  • spk_reset (str, default 'hard') – Reset mechanism after spike generation: - ‘soft’: subtract threshold V = V - V_th - ‘hard’: strict reset using stop_gradient

  • name (str, optional) – Name of the neuron layer.

V#

Membrane potential.

Type:

HiddenState

u#

Recovery variable.

Type:

HiddenState

See also

IzhikevichRef

Izhikevich model with absolute refractory period.

Notes

  • The quadratic term in the voltage equation (0.04*V^2) provides a sharp spike upstroke similar to biological neurons [1].

  • Different combinations of parameters (a, b, c, d) can reproduce various neuronal behaviors including regular spiking, intrinsically bursting, chattering, and fast spiking [2].

  • The model uses a hard reset mechanism where V is set to c and u is incremented by d when a spike occurs.

  • Parameter ranges: a ∈ [0.01, 0.1], b ∈ [0.2, 0.3], c ∈ [-65, -50], d ∈ [0.1, 10]

References

Examples

>>> import brainpy
>>> import brainstate
>>> import saiunit as u
>>> # Create an Izhikevich neuron layer with 10 neurons
>>> izh = brainpy.state.Izhikevich(10)
>>> # Initialize the state
>>> izh.init_state(batch_size=1)
>>> # Apply an input current and update the neuron state
>>> spikes = izh.update(x=10.*u.mV/u.ms)
get_spike(V=None)[source]#

Generate spikes based on neuron state variables.

This abstract method must be implemented by subclasses to define the spike generation mechanism. The method should use the surrogate gradient function self.spk_fun to enable gradient-based learning.

Parameters:
  • *args – Positional arguments (typically state variables like membrane potential)

  • **kwargs – Keyword arguments

Returns:

Binary spike tensor where 1 indicates a spike and 0 indicates no spike.

Return type:

ArrayLike

Raises:

NotImplementedError – If the subclass does not implement this method.

init_state(batch_size=None, **kwargs)[source]#

State initialization function.

reset_state(batch_size=None, **kwargs)[source]#

State resetting function.