DeltaPlusCurrent¶
- class DeltaPlusCurrent(shape: tuple[int, ...] | int, step_time: float, *, spike_charge: float, delay: float = 0.0, interp_mode: Literal['nearest', 'previous'] = 'previous', interp_tol: float = 0.0, current_overbound: float | None = 0.0, spike_overbound: bool | None = False, batch_size: int = 1, inplace: bool = False)[source]¶
Bases:
SpikeCurrentMixin,InfernoSynapseMemoryless synapse which responds instantaneously to input, with passthrough current.
\[\begin{split}I(t) = \begin{cases} Q / \Delta t + I_x & \text{presynaptic spike} \\ I_x & \text{otherwise} \end{cases}\end{split}\]- spike_¶
RecordTensorinterface for spikes.
- current_¶
RecordTensorinterface for currents.
- Parameters:
shape (tuple[int, ...] | int) – shape of the group of synapses being simulated.
step_time (float) – length of a simulation time step, \(\Delta t\), in \(\text{ms}\).
spike_charge (float) – charge carried by each presynaptic spike, \(Q\), in \(\text{pC}\).
delay (float, optional) – maximum supported delay, in \(\text{ms}\). Defaults to
0.0.interp_mode (Literal["nearest", "previous"], optional) – interpolation mode for selectors between observations. Defaults to
"previous".interp_tol (float, optional) – maximum difference in time from an observation to treat as co-occurring, in \(\text{ms}\). Defaults to
0.0.current_overbound (float | None, optional) – value to replace currents out of bounds, uses values at observation limits if
None. Defaults to0.0.spike_overbound (bool | None, optional) – value to replace spikes out of bounds, uses values at observation limits if
None. Defaults toFalse.batch_size (int, optional) – size of input batches for simulation. Defaults to
1.inplace (bool) – if write operations on
RecordTensorattributes should be performed with in-place operations. Defaults toFalse.
See also
For more details and references, visit Delta in the zoo.
- forward(*inputs: Tensor, **kwargs) Tensor[source]¶
Runs a simulation step of the synaptic dynamics.
- Parameters:
*inputs (torch.Tensor) – input spikes to the synapse.
- Returns:
synaptic currents after simulation step.
- Return type:
Important
The first tensor of
*inputswill represent the input spikes. Any subsequent tensors will be treated as injected current. These must be broadcastable withcurrent.
- classmethod partialconstructor(spike_charge: float, interp_mode: Literal['nearest', 'previous'] = 'previous', interp_tol: float = 0.0, current_overbound: float | None = 0.0, spike_overbound: bool | None = False, inplace: bool = False) SynapseConstructor[source]¶
Returns a function with a common signature for synapse construction.
- Parameters:
spike_charge (float) – charge carried by each presynaptic spike, in \(\text{pC}\).
interp_mode (Literal["nearest", "previous"], optional) – interpolation mode for selectors between observations. Defaults to
"previous".interp_tol (float, optional) – maximum difference in time from an observation to treat as co-occurring, in \(\text{ms}\). Defaults to
0.0.current_overbound (float | None, optional) – value to replace currents out of bounds, uses values at observation limits if
None. Defaults to0.0.spike_overbound (bool | None, optional) – value to replace spikes out of bounds, uses values at observation limits if
None. Defaults toFalse.inplace (bool) – if write operations on
RecordTensorattributes should be performed with in-place operations. Defaults toFalse.
- Returns:
partial constructor for synapse.
- Return type: