AdQuaIF#
- class brainpy.state.AdQuaIF(in_size, R=Quantity(1., "ohm"), tau=Quantity(10., "ms"), tau_w=Quantity(10., "ms"), V_th=Quantity(-30., "mV"), V_reset=Quantity(-68., "mV"), V_rest=Quantity(-65., "mV"), V_c=Quantity(-50., "mV"), c=Quantity(0.07, "1 / mV"), a=Quantity(1., "S"), b=Quantity(0.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 Quadratic Integrate-and-Fire (AdQuaIF) neuron model.
This model extends the QuaIF model by adding an adaptation current that increases after each spike and decays exponentially between spikes. The adaptation mechanism produces spike-frequency adaptation and enables the neuron to exhibit various firing patterns.
The model is characterized by the following differential equations:
\[ \tau \frac{dV}{dt} = c(V - V_{rest})(V - V_c) - w + R \cdot I(t) \]\[ \tau_w \frac{dw}{dt} = a(V - V_{rest}) - w \]After a spike: \(V \rightarrow V_{reset}\), \(w \rightarrow w + b\)
- 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, default10. * u.ms) – Adaptation current time constant.V_th (
ArrayLike, default-30. * u.mV) – Firing threshold voltage.V_reset (
ArrayLike, default-68. * u.mV) – Reset voltage after spike.V_rest (
ArrayLike, default-65. * u.mV) – Resting membrane potential.V_c (
ArrayLike, default-50. * u.mV) – Critical voltage for spike initiation.c (
ArrayLike, default0.07 / u.mV) – Coefficient describing membrane potential update.a (
ArrayLike, default1. * u.siemens) – Coupling strength from voltage to adaptation current.b (
ArrayLike, default0.1 * u.mA) – Increment of 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.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
QuaIFQuadratic IF without adaptation.
AdQuaIFRefAdaptive quadratic IF with refractory period.
AdExIFAdaptive exponential IF (alternative adaptive model).
Notes
The adaptation current w provides negative feedback, reducing firing rate.
Parameter ‘a’ controls subthreshold adaptation (coupling from V to w).
Parameter ‘b’ controls spike-triggered adaptation (increment after spike).
With appropriate parameters, can exhibit regular spiking, bursting, etc. [1].
The adaptation time constant tau_w determines adaptation speed.
For a detailed bifurcation analysis of this model class, see [2].
References
Examples
>>> import brainpy >>> import brainstate >>> import saiunit as u >>> # Create an AdQuaIF neuron layer with 10 neurons >>> adquaif = brainpy.state.AdQuaIF(10, tau=10*u.ms, tau_w=100*u.ms, ... a=1.0*u.siemens, b=0.1*u.mA) >>> # Initialize the state >>> adquaif.init_state(batch_size=1) >>> # Apply an input current and observe spike-frequency adaptation >>> spikes = adquaif.update(x=3.0*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.