voltage_thresholding_constant

voltage_thresholding_constant(inputs: Tensor, refracs: Tensor, dynamics: OneToOne[Tensor], voltages: Tensor | None = None, *, step_time: float | Tensor, reset_v: 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{reset}\]
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, optional) – 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}\).

  • reset_v (float | torch.Tensor) – membrane voltage after an action potential is generated, \(V_\text{reset}\), in \(\text{mV}\).

  • 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}\).

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]