WangBuzsakiHH#

class brainpy.state.WangBuzsakiHH(in_size, ENa=Quantity(55., "mV"), gNa=Quantity(35., "mS"), EK=Quantity(-90., "mV"), gK=Quantity(9., "mS"), EL=Quantity(-65., "mV"), gL=Quantity(0.1, "mS"), V_th=Quantity(20., "mV"), phi=5.0, C=Quantity(1., "uF"), V_initializer=Constant(value=-65. mV), h_initializer=Constant(value=0.6), n_initializer=Constant(value=0.32), spk_fun=ReluGrad(alpha=0.3, width=1.0), spk_reset='soft', name=None)#

Wang-Buzsaki model, an implementation of a modified Hodgkin-Huxley model.

Each model is described by a single compartment and obeys the current balance equation:

\[C_{m} \frac{d V}{d t}=-I_{\mathrm{Na}}-I_{\mathrm{K}}-I_{\mathrm{L}}+I_{\mathrm{app}}\]

where \(C_{m}=1 \mu \mathrm{F} / \mathrm{cm}^{2}\) and \(I_{\mathrm{app}}\) is the injected current (in \(\mu \mathrm{A} / \mathrm{cm}^{2}\) ). The leak current \(I_{\mathrm{L}}=g_{\mathrm{L}}\left(V-E_{\mathrm{L}}\right)\) has a conductance \(g_{\mathrm{L}}=0.1 \mathrm{mS} / \mathrm{cm}^{2}\).

The spike-generating \(\mathrm{Na}^{+}\) and \(\mathrm{K}^{+}\) voltage-dependent ion currents are of the Hodgkin-Huxley type. The transient sodium current \(I_{\mathrm{Na}}=g_{\mathrm{Na}} m_{\infty}^{3} h\left(V-E_{\mathrm{Na}}\right)\), where the activation variable \(m\) is assumed fast and substituted by its steady-state function \(m_{\infty}=\alpha_{m} /\left(\alpha_{m}+\beta_{m}\right)\); \(\alpha_{m}(V)=-0.1(V+35) /(\exp (-0.1(V+35))-1)\), \(\beta_{m}(V)=4 \exp (-(V+60) / 18)\).

The inactivation variable \(h\) obeys:

\[\frac{d h}{d t}=\phi\left(\alpha_{h}(1-h)-\beta_{h} h\right)\]

where \(\alpha_{h}(V)=0.07 \exp (-(V+58) / 20)\) and \(\beta_{h}(V)=1 /(\exp (-0.1(V+28)) +1)\).

The delayed rectifier \(I_{\mathrm{K}}=g_{\mathrm{K}} n^{4}\left(V-E_{\mathrm{K}}\right)\), where the activation variable \(n\) obeys:

\[\frac{d n}{d t}=\phi\left(\alpha_{n}(1-n)-\beta_{n} n\right)\]

with \(\alpha_{n}(V)=-0.01(V+34) /(\exp (-0.1(V+34))-1)\) and \(\beta_{n}(V)=0.125\exp (-(V+44) / 80)\).

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

  • ENa (ArrayLike, default 55. * u.mV) – Reversal potential of sodium.

  • gNa (ArrayLike, default 35. * u.msiemens) – Maximum conductance of sodium channel.

  • EK (ArrayLike, default -90. * u.mV) – Reversal potential of potassium.

  • gK (ArrayLike, default 9. * u.msiemens) – Maximum conductance of potassium channel.

  • EL (ArrayLike, default -65. * u.mV) – Reversal potential of leak channel.

  • gL (ArrayLike, default 0.1 * u.msiemens) – Conductance of leak channel.

  • V_th (ArrayLike, default 20. * u.mV) – Threshold of the membrane spike.

  • phi (ArrayLike, default 5.0) – Temperature regulator constant.

  • C (ArrayLike, default 1.0 * u.ufarad) – Membrane capacitance.

  • V_initializer (Callable) – Initializer for membrane potential.

  • h_initializer (Callable) – Initializer for h channel.

  • n_initializer (Callable) – Initializer for n channel.

  • spk_fun (Callable, default surrogate.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

h#

Sodium inactivation variable.

Type:

HiddenState

n#

Potassium activation variable.

Type:

HiddenState

See also

HH

Classic Hodgkin-Huxley model.

MorrisLecar

Two-dimensional reduced excitation model.

Notes

  • This model was designed for studying gamma oscillations in hippocampal interneuronal networks [1].

  • The sodium activation variable m is assumed fast and replaced by its steady-state function.

References

Examples

>>> import brainpy
>>> import brainstate
>>> import saiunit as u
>>> # Create a WangBuzsakiHH neuron layer with 10 neurons
>>> wb = brainpy.state.WangBuzsakiHH(10)
>>> # Initialize the state
>>> wb.init_state(batch_size=1)
>>> # Apply an input current and update the neuron state
>>> spikes = wb.update(x=1.*u.uA)
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.