adaptive_currents_linear¶
- adaptive_currents_linear(adaptations: Tensor, voltages: Tensor, spikes: Tensor, *, step_time: float | Tensor, rest_v: float | Tensor, time_constant: float | Tensor, voltage_coupling: float | Tensor, spike_increment: float | Tensor, refracs: Tensor | None = None) Tensor[source]¶
Update adaptive currents based on membrane potential and postsynaptic spikes.
Implemented as an approximation using Euler’s method.
\[w_k(t + \Delta t) = \frac{\Delta t}{\tau_k} \left[ a_k \left[ V_m(t) - V_\text{rest} \right] - w_k(t) \right] + w_k(t)\]If a spike was generated at time \(t\), then.
\[w_k(t) \leftarrow w_k(t) + b_k\]- Parameters:
adaptations (torch.Tensor) – last adaptations applied to input current, \(w_k\), in \(\text{nA}\).
voltages (torch.Tensor) – membrane voltages \(V_m(t)\), 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, in \(\text{ms}\).
rest_v (float | torch.Tensor) – membrane potential difference at equilibrium, \(V_\text{rest}\), in \(\text{mV}\).
time_constant (float | torch.Tensor) – time constant of exponential decay, \(\tau_k\), in \(\text{ms}\).
voltage_coupling (float | torch.Tensor) – strength of coupling to membrane voltage, \(a_k\), in \(\mu\text{S}\).
spike_increment (float | torch.Tensor) – amount by which the adaptive current is increased after a spike, \(b_k\), in \(\text{nA}\).
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 input currents, in \(\text{nA}\).
- Return type:
Shape
adaptations:\(N_0 \times \cdots \times K\)
voltages,spikes,refracs:\([B] \times N_0 \times \cdots\)
rest_v:Broadcastable with
voltages,spikes, andrefracs.step_time,voltage_coupling,spike_increment,time_constant: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 Current, Linear in the zoo.