voltage_thresholding_linear

voltage_thresholding_linear(inputs: Tensor, refracs: Tensor, dynamics: OneToOne[Tensor], voltages: Tensor | None = None, *, step_time: float | Tensor, rest_v: float | Tensor, v_slope: float | Tensor, v_intercept: float | Tensor, thresh_v: float | Tensor, refrac_t: float | Tensor) tuple[Tensor, Tensor, Tensor][source]

Manage refractory periods, spiking, and voltage based on voltage thresholding.

Implements the logic, that when.

\[V_m(t) \geq \Theta(t)\]

Membrane voltages are reset as.

\[V_m(t) \leftarrow V_\text{rest} + m_v \left[ V_m(t) - V_\text{rest} \right] - b_v\]
Parameters:
  • inputs (torch.Tensor) – presynaptic currents, \(I(t)\), in \(\text{nA}\).

  • refracs (torch.Tensor) – remaining absolute refractory periods, in \(\text{ms}\).

  • dynamics (OneToOne[torch.Tensor]) – function which given input currents in \(\text{nA}\) returns the updated membrane voltages, \(V_m(t)\), in \(\text{mV}\).

  • voltages (torch.Tensor | None) – membrane voltages, V_m(t), in \(\text{mV}\), to maintain while in refractory periods, voltages not held if None. Defaults to None.

  • step_time (float | torch.Tensor) – length of a simulation time step, in \(\text{ms}\).

  • rest_v (float | torch.Tensor) – membrane potential difference at equilibrium, \(V_\text{rest}\), in \(\text{mV}\).

  • v_slope (float | torch.Tensor) – additive parameter controlling reset voltage, \(b_v\), in \(\text{mV}\).

  • v_intercept (float | torch.Tensor) – multiplicative parameter controlling reset voltage, \(m_v\), unitless.

  • thresh_v (float | torch.Tensor) – membrane voltage at which action potentials are generated, Theta(t), in \(\text{mV}\).

  • refrac_t (float | torch.Tensor) – length the absolute refractory period, in \(\text{ms}\).

  • voltages – membrane voltages, V_m(t), in \(\text{mV}\), to maintain while in refractory periods, voltages not held if None. Defaults to None.

Returns:

tuple of output and updated state containing:

  • spikes: if the corresponding neuron generated an action potential.

  • voltages: updated membrane potentials, in \(\text{mV}\).

  • refracs: remaining absolute refractory periods, in \(\text{ms}\).

Return type:

tuple[torch.Tensor, torch.Tensor, torch.Tensor]