AdExIF#
- class brainpy.state.AdExIF(in_size, R=Quantity(1., "ohm"), tau=Quantity(10., "ms"), tau_w=Quantity(30., "ms"), V_th=Quantity(-55., "mV"), V_reset=Quantity(-68., "mV"), V_rest=Quantity(-65., "mV"), V_T=Quantity(-59.9, "mV"), delta_T=Quantity(3.48, "mV"), a=Quantity(1., "S"), b=Quantity(1., "mA"), V_initializer=Constant(value=-65. mV), w_initializer=Constant(value=0. mA), spk_fun=ReluGrad(alpha=0.3, width=1.0), spk_reset='soft', name=None)#
Adaptive exponential Integrate-and-Fire (AdExIF) neuron model.
This model extends
ExpIFby adding an adaptation currentwthat is incremented after each spike and relaxes with time constanttau_w. The membrane dynamics are governed by two coupled differential equations [1]:\[ \tau \frac{dV}{dt} = -(V - V_{rest}) + \Delta_T \exp\left(\frac{V - V_T}{\Delta_T}\right) - R w + R \cdot I(t) \]\[ \tau_w \frac{dw}{dt} = a (V - V_{rest}) - w \]After each spike the membrane potential is reset and the adaptation current increases by
b. This simple mechanism generates rich firing patterns such as spike-frequency adaptation and bursting.- Parameters:
in_size (
Size) – Size of the input to the neuron.R (
ArrayLike, default1. * u.ohm) – Membrane resistance.tau (
ArrayLike, default10. * u.ms) – Membrane time constant.tau_w (
ArrayLike, default30. * u.ms) – Adaptation current time constant.V_th (
ArrayLike, default-55. * u.mV) – Spike threshold used for reset.V_reset (
ArrayLike, default-68. * u.mV) – Reset potential after spike.V_rest (
ArrayLike, default-65. * u.mV) – Resting membrane potential.V_T (
ArrayLike, default-59.9 * u.mV) – Threshold of the exponential term.delta_T (
ArrayLike, default3.48 * u.mV) – Spike slope factor controlling the sharpness of spike initiation.a (
ArrayLike, default1. * u.siemens) – Coupling strength from voltage to adaptation current.b (
ArrayLike, default1. * u.mA) – Increment of the adaptation current after a spike.V_initializer (
Callable) – Initializer for the membrane potential state.w_initializer (
Callable) – Initializer for the adaptation current.spk_fun (
Callable, defaultsurrogate.ReluGrad()) – Surrogate gradient function for the spike generation.spk_reset (
str, default'soft') – Reset mechanism after spike generation.name (
str, optional) – Name of the neuron layer.
- V#
Membrane potential.
- Type:
HiddenState
- w#
Adaptation current.
- Type:
HiddenState
See also
Notes
The AdEx model can reproduce a wide variety of neuronal firing patterns including regular spiking, bursting, and spike-frequency adaptation.
For detailed information about this model and its parameters, see [1] and [2].
References
See also
brainpy.dyn.AdExIFfor the dynamical-system counterpart.Examples
>>> import brainpy >>> import brainstate >>> import saiunit as u >>> # Create an AdExIF neuron layer with 10 neurons >>> adexif = brainpy.state.AdExIF(10, tau=10*u.ms) >>> # Initialize the state >>> adexif.init_state(batch_size=1) >>> # Apply an input current and update the neuron state >>> spikes = adexif.update(x=1.5*u.mA)
- 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_funto 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.