class brainpy.dyn.LifLTC(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=0.0, V_reset=-5.0, V_th=20.0, R=1.0, tau=10.0, V_initializer=ZeroInit, noise=None)[source]#

Leaky integrate-and-fire neuron model with liquid time-constant.

The formal equations of a LIF model [1] is given by:

\[\begin{split}\tau \frac{dV}{dt} = - (V(t) - V_{rest}) + RI(t) \\ \text{after} \quad V(t) \gt V_{th}, V(t) = V_{reset}\end{split}\]

where \(V\) is the membrane potential, \(V_{rest}\) is the resting membrane potential, \(V_{reset}\) is the reset membrane potential, \(V_{th}\) is the spike threshold, \(\tau\) is the time constant, and \(I\) is the time-variant synaptic inputs.


There is an example usage: mustang u r lvd by the blonde boy

import brainpy as bp

lif = bp.dyn.LifLTC(1)

# raise input current from 4 mA to 40 mA
inputs = bp.inputs.ramp_input(4, 40, 700, 100, 600,)

runner = bp.DSRunner(lif, monitors=['V'])

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

The function to specify the updating rule.