GifLTC#
- class brainpy.dyn.GifLTC(size, sharding=None, keep_size=False, mode=None, name=None, spk_fun=InvSquareGrad(alpha=100.0), spk_dtype=None, spk_reset='soft', detach_spk=False, method='exp_auto', init_var=True, scaling=None, V_rest=-70.0, V_reset=-70.0, V_th_inf=-50.0, V_th_reset=-60.0, R=20.0, tau=20.0, a=0.0, b=0.01, k1=0.2, k2=0.02, R1=0.0, R2=1.0, A1=0.0, A2=0.0, V_initializer=OneInit(value=-70.0), I1_initializer=ZeroInit, I2_initializer=ZeroInit, Vth_initializer=OneInit(value=-50.0))[source]#
Generalized Integrate-and-Fire model with liquid time-constant.
Model Descriptions
The generalized integrate-and-fire model [1] is given by
\[ \begin{align}\begin{aligned}&\frac{d I_j}{d t} = - k_j I_j\\&\frac{d V}{d t} = ( - (V - V_{rest}) + R\sum_{j}I_j + RI) / \tau\\&\frac{d V_{th}}{d t} = a(V - V_{rest}) - b(V_{th} - V_{th\infty})\end{aligned}\end{align} \]When \(V\) meet \(V_{th}\), Generalized IF neuron fires:
\[ \begin{align}\begin{aligned}&I_j \leftarrow R_j I_j + A_j\\&V \leftarrow V_{reset}\\&V_{th} \leftarrow max(V_{th_{reset}}, V_{th})\end{aligned}\end{align} \]Note that \(I_j\) refers to arbitrary number of internal currents.
References
Examples
There is a simple usage: you r bound to be together, roy and edward
import brainpy as bp import matplotlib.pyplot as plt # Tonic Spiking neu = bp.dyn.Gif(1) inputs = bp.inputs.ramp_input(.2, 2, 400, 0, 400) runner = bp.DSRunner(neu, monitors=['V', 'V_th']) runner.run(inputs=inputs) ts = runner.mon.ts fig, gs = bp.visualize.get_figure(1, 1, 4, 8) ax1 = fig.add_subplot(gs[0, 0]) ax1.plot(ts, runner.mon.V[:, 0], label='V') ax1.plot(ts, runner.mon.V_th[:, 0], label='V_th') plt.show()
Model Examples
Model Parameters
Parameter
Init Value
Unit
Explanation
V_rest
-70
mV
Resting potential.
V_reset
-70
mV
Reset potential after spike.
V_th_inf
-50
mV
Target value of threshold potential \(V_{th}\) updating.
V_th_reset
-60
mV
Free parameter, should be larger than \(V_{reset}\).
R
20
Membrane resistance.
tau
20
ms
Membrane time constant. Compute by \(R * C\).
a
0
Coefficient describes the dependence of \(V_{th}\) on membrane potential.
b
0.01
Coefficient describes \(V_{th}\) update.
k1
0.2
Constant pf \(I1\).
k2
0.02
Constant of \(I2\).
R1
0
Free parameter. Describes dependence of \(I_1\) reset value on \(I_1\) value before spiking.
R2
1
Free parameter. Describes dependence of \(I_2\) reset value on \(I_2\) value before spiking.
A1
0
Free parameter.
A2
0
Free parameter.
Model Variables
Variables name
Initial Value
Explanation
V
-70
Membrane potential.
input
0
External and synaptic input current.
spike
False
Flag to mark whether the neuron is spiking.
V_th
-50
Spiking threshold potential.
I1
0
Internal current 1.
I2
0
Internal current 2.
t_last_spike
-1e7
Last spike time stamp.
- reset_state(batch_size=None, **kwargs)[source]#
Reset function which resets local states in this model.
Simply speaking, this function should implement the logic of resetting of local variables in this node.
See https://brainpy.readthedocs.io/en/latest/tutorial_toolbox/state_resetting.html for details.