EIF¶
- class EIF(shape: tuple[int, ...] | int, step_time: float, *, rest_v: float, rheobase_v: float, sharpness: float, reset_v: float, thresh_v: float, refrac_t: float, time_constant: float, resistance: float = 1.0, batch_size: int = 1)[source]¶
Bases:
VoltageMixin,SpikeRefractoryMixin,InfernoNeuronSimulation of exponential integrate-and-fire (EIF) neuron dynamics.
Implemented as an approximation using Euler’s method.
\[V_m(t + \Delta t) = \frac{\Delta t}{\tau_m} \left[ - \left[V_m(t) - V_\text{rest}\right] + \Delta_T \exp \left(\frac{V_m(t) - V_T}{\Delta_T}\right) + R_mI(t) \right]+ V_m(t)\]If a spike was generated at time \(t\), then.
\[V_m(t) \leftarrow V_\text{reset}\]- Parameters:
shape (tuple[int, ...] | int) – shape of the group of neurons being simulated.
step_time (float) – length of a simulation time step, \(\Delta t\), in \(\text{ms}\).
rest_v (float) – membrane potential difference at equilibrium, \(V_\text{rest}\), in \(\text{mV}\).
rheobase_v (float) – membrane potential difference approaching the potential at which potential rapidly increases, \(V_T\), in \(\text{mV}\).
sharpness (float) – steepness of the natural increase in membrane potential above the rheobase voltage, \(\Delta_T\), in \(\text{mV}\).
reset_v (float) – membrane voltage after an action potential is generated, \(V_\text{reset}\), in \(\text{mV}\).
thresh_v (float) – membrane voltage at which action potentials are generated, in \(\text{mV}\).
refrac_t (float) – length the absolute refractory period, in \(\text{ms}\).
time_constant (float) – time constant of exponential decay for membrane voltage, \(\tau_m\), in \(\text{ms}\).
resistance (float, optional) – resistance across the cell membrane, \(R_m\), in \(\text{M}\Omega\). Defaults to
1.0.batch_size (int, optional) – size of input batches for simulation. Defaults to
1.
See also
For more details and references, visit Exponential Integrate-and-Fire (EIF) in the zoo.
- forward(inputs: Tensor, refrac_lock=True, **kwargs) Tensor[source]¶
Runs a simulation step of the neuronal dynamics.
- Parameters:
inputs (torch.Tensor) – presynaptic currents, \(I(t)\), in \(\text{nA}\).
refrac_lock (bool, optional) – if membrane voltages should be fixed while in the refractory period. Defaults to
True.
- Returns:
if the corresponding neuron generated an action potential.
- Return type: