# brainpy.neurons.WangBuzsakiModel#

class brainpy.neurons.WangBuzsakiModel(*args, input_var=True, noise=None, **kwargs)[source]#

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{syn}}+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}$$, so that the passive time constant $$\tau_{0}=C_{m} / g_{\mathrm{L}}=10 \mathrm{msec} ; E_{\mathrm{L}}=-65 \mathrm{mV}$$.

The spike-generating $$\mathrm{Na}^{+}$$ and $$\mathrm{K}^{+}$$ voltage-dependent ion currents $$\left(I_{\mathrm{Na}}\right.$$ and $$I_{\mathrm{K}}$$ ) are of the Hodgkin-Huxley type (Hodgkin and Huxley, 1952). 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 a first-order kinetics:

$\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) \cdot g_{\mathrm{Na}}=35 \mathrm{mS} / \mathrm{cm}^{2}$$ ; $$E_{\mathrm{Na}}=55 \mathrm{mV}, \phi=5 .$$

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

$\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)$$ ; $$g_{\mathrm{K}}=9 \mathrm{mS} / \mathrm{cm}^{2}$$, and $$E_{\mathrm{K}}=-90 \mathrm{mV}$$.

Parameters:
• size (sequence of int, int) – The size of the neuron group.

• ENa (float, ArrayType, Initializer, callable) – The reversal potential of sodium. Default is 50 mV.

• gNa (float, ArrayType, Initializer, callable) – The maximum conductance of sodium channel. Default is 120 msiemens.

• EK (float, ArrayType, Initializer, callable) – The reversal potential of potassium. Default is -77 mV.

• gK (float, ArrayType, Initializer, callable) – The maximum conductance of potassium channel. Default is 36 msiemens.

• EL (float, ArrayType, Initializer, callable) – The reversal potential of learky channel. Default is -54.387 mV.

• gL (float, ArrayType, Initializer, callable) – The conductance of learky channel. Default is 0.03 msiemens.

• V_th (float, ArrayType, Initializer, callable) – The threshold of the membrane spike. Default is 20 mV.

• C (float, ArrayType, Initializer, callable) – The membrane capacitance. Default is 1 ufarad.

• phi (float, ArrayType, Initializer, callable) – The temperature regulator constant.

• V_initializer (ArrayType, Initializer, callable) – The initializer of membrane potential.

• h_initializer (ArrayType, Initializer, callable) – The initializer of h channel.

• n_initializer (ArrayType, Initializer, callable) – The initializer of n channel.

• method (str) – The numerical integration method.

• name (str) – The group name.

References

__init__(*args, input_var=True, noise=None, **kwargs)[source]#

Methods

 __init__(*args[, input_var, noise]) add_aft_update(key, fun) Add the after update into this node add_bef_update(key, fun) Add the before update into this node add_inp_fun(key, fun) Add an input function. clear_input() Empty function of clearing inputs. cpu() Move all variable into the CPU device. cuda() Move all variables into the GPU device. dV(V, t, h, n, I) dh(h, t, V) dn(n, t, V) get_aft_update(key) Get the after update of this node by the given key. get_batch_shape([batch_size]) get_bef_update(key) Get the before update of this node by the given key. get_delay_data(identifier, delay_pos, *indices) Get delay data according to the provided delay steps. get_delay_var(name) get_inp_fun(key) Get the input function. get_local_delay(var_name, delay_name) Get the delay at the given identifier (name). has_aft_update(key) Whether this node has the after update of the given key. has_bef_update(key) Whether this node has the before update of the given key. init_param(param[, shape, sharding]) Initialize parameters. init_variable(var_data, batch_or_mode[, ...]) Initialize variables. jit_step_run(i, *args, **kwargs) The jitted step function for running. load_state(state_dict, **kwargs) Load states from a dictionary. load_state_dict(state_dict[, warn, compatible]) Copy parameters and buffers from state_dict into this module and its descendants. m_inf(V) nodes([method, level, include_self]) Collect all children nodes. register_delay(identifier, delay_step, ...) Register delay variable. register_implicit_nodes(*nodes[, node_cls]) register_implicit_vars(*variables[, var_cls]) register_local_delay(var_name, delay_name[, ...]) Register local relay at the given delay time. reset(*args, **kwargs) Reset function which reset the whole variables in the model (including its children models). reset_local_delays([nodes]) Reset local delay variables. reset_state([batch_size]) Reset function which resets local states in this model. return_info() save_state(**kwargs) Save states as a dictionary. setattr(key, value) rtype: None state_dict(**kwargs) Returns a dictionary containing a whole state of the module. step_run(i, *args, **kwargs) The step run function. sum_inputs(*args[, init, label]) Summarize all inputs by the defined input functions .cur_inputs. to(device) Moves all variables into the given device. tpu() Move all variables into the TPU device. tracing_variable(name, init, shape[, ...]) Initialize the variable which can be traced during computations and transformations. train_vars([method, level, include_self]) The shortcut for retrieving all trainable variables. tree_flatten() Flattens the object as a PyTree. tree_unflatten(aux, dynamic_values) Unflatten the data to construct an object of this class. unique_name([name, type_]) Get the unique name for this object. update([x]) The function to specify the updating rule. update_local_delays([nodes]) Update local delay variables. vars([method, level, include_self, ...]) Collect all variables in this node and the children nodes.

Attributes

 derivative mode Mode of the model, which is useful to control the multiple behaviors of the model. name Name of the model. supported_modes Supported computing modes. varshape The shape of variables in the neuron group. cur_inputs