adaptive_thresholds_linear_spike¶
- adaptive_thresholds_linear_spike(adaptations: Tensor, spikes: Tensor, *, step_time: float | Tensor, time_constant: float | Tensor, spike_increment: float | Tensor, refracs: Tensor | None = None) Tensor[source]¶
Update adaptive thresholds based on postsynaptic spikes.
\[\theta_k(t + \Delta t) = \theta_k(t) \exp\left(-\frac{\Delta t}{\tau_k}\right)\]If a spike was generated at time \(t\), then.
\[\theta_k(t) \leftarrow \theta_k(t) + a_k\]- Parameters:
adaptations (torch.Tensor) – last adaptations applied to membrane voltage threshold, \(\theta_k\), in \(\text{mV}\).
spikes (torch.Tensor) – if the corresponding neuron generated an action potential.
step_time (float | torch.Tensor) – length of a simulation time step, \(\Delta t\), in \(\text{ms}\).
time_constant (float | torch.Tensor) – time constant of exponential decay for the adaptations, \(\tau_k\), in \(\text{ms}\).
spike_increment (torch.Tensor) – amount by which the adaptive threshold is increased after a spike, \(a_k\), in \(\text{mV}\).
refracs (torch.Tensor | None) – remaining absolute refractory periods, in \(\text{ms}\), when not
None, adaptations of neurons in their absolute refractory periods are maintained. Defaults toNone.
- Returns:
updated adaptations for membrane voltage threshold, in \(\text{mV}\).
- Return type:
Shape
adaptations:\(N_0 \times \cdots \times K\)
spikes,refracs:\([B] \times N_0 \times \cdots\)
step_time,time_constant,spike_increment:Broadcastable with
adaptations.return:\([B] \times N_0 \times \cdots \times K\)
- Where:
\(B\) is the batch size.
\(N_0, \ldots\) are dimensions of the group of neurons simulated.
\(K\) is the number of sets of adaptation parameters.
Tip
This function doesn’t automatically reduce along the batch dimension, this should generally be done by averaging along the \(0^\text{th}\) dimension.
See also
For more details and references, visit Adaptive Threshold, Linear Spike-Dependent in the zoo.