QuaIFRef

QuaIFRef#

class brainpy.dyn.QuaIFRef(size, sharding=None, keep_size=False, mode=None, spk_fun=InvSquareGrad(alpha=100.0), spk_dtype=None, spk_reset='soft', detach_spk=False, method='exp_auto', name=None, init_var=True, scaling=None, V_rest=-65.0, V_reset=-68.0, V_th=-30.0, V_c=-50.0, c=0.07, R=1.0, tau=10.0, V_initializer=ZeroInit, tau_ref=0.0, ref_var=False, noise=None)[source]#

Quadratic Integrate-and-Fire neuron model.

Model Descriptions

In contrast to physiologically accurate but computationally expensive neuron models like the Hodgkin–Huxley model, the QIF model [1] seeks only to produce action potential-like patterns and ignores subtleties like gating variables, which play an important role in generating action potentials in a real neuron. However, the QIF model is incredibly easy to implement and compute, and relatively straightforward to study and understand, thus has found ubiquitous use in computational neuroscience.

\[\tau \frac{d V}{d t}=c(V-V_{rest})(V-V_c) + RI(t)\]

where the parameters are taken to be \(c\) =0.07, and \(V_c = -50 mV\) (Latham et al., 2000).

References

Examples

There is an example usage:

import brainpy as bp

neu = bp.dyn.QuaIFRef(2)

# section input with wiener process
inp1 = bp.inputs.wiener_process(500., n=1, t_start=100., t_end=400.).flatten()
inputs = bp.inputs.section_input([0., 22., 0.], [100., 300., 100.]) + inp1

runner = bp.DSRunner(neu, monitors=['V'])
runner.run(inputs=inputs)

bp.visualize.line_plot(runner.mon['ts'], runner.mon['V'], plot_ids=(0, 1), show=True)

Model Parameters

Parameter

Init Value

Unit

Explanation

V_rest

-65

mV

Resting potential.

V_reset

-68

mV

Reset potential after spike.

V_th

-30

mV

Threshold potential of spike and reset.

V_c

-50

mV

Critical voltage for spike initiation. Must be larger than V_rest.

c

.07

Coefficient describes membrane potential update. Larger than 0.

R

1

Membrane resistance.

tau

10

ms

Membrane time constant. Compute by R * C.

tau_ref

0

ms

Refractory period length.

Model Variables

Variables name

Initial Value

Explanation

V

0

Membrane potential.

input

0

External and synaptic input current.

spike

False

Flag to mark whether the neuron is spiking.

refractory

False

Flag to mark whether the neuron is in refractory period.

t_last_spike

-1e7

Last spike time stamp.

Parameters:
  • size (TypeVar(Shape, int, Tuple[int, ...])) – int, or sequence of int. The neuronal population size.

  • sharding (Union[Sequence[str], Device, Sharding, None]) – The sharding strategy.

  • keep_size (bool) – bool. Keep the neuron group size.

  • mode (Optional[Mode]) – Mode. The computing mode.

  • name (Optional[str]) – str. The group name.

  • spk_fun (Callable) – callable. The spike activation function.

  • detach_spk (bool) – bool.

  • method (str) – str. The numerical integration method.

  • spk_type – The spike data type.

  • spk_reset (str) – The way to reset the membrane potential when the neuron generates spikes. This parameter only works when the computing mode is TrainingMode. It can be soft and hard. Default is soft.

  • tau_ref (Union[float, TypeVar(ArrayType, Array, Variable, TrainVar, Array, ndarray), Callable]) – float, ArrayType, callable. Refractory period length (ms).

  • has_ref_var – bool. Whether has the refractory variable. Default is False.

update(x=None)[source]#

The function to specify the updating rule.