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, InfernoSynapse

Memoryless 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_

RecordTensor interface for spikes.

current_

RecordTensor interface 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 to 0.0.

  • spike_overbound (bool | None, optional) – value to replace spikes out of bounds, uses values at observation limits if None. Defaults to False.

  • batch_size (int, optional) – size of input batches for simulation. Defaults to 1.

  • inplace (bool) – if write operations on RecordTensor attributes should be performed with in-place operations. Defaults to False.

See also

For more details and references, visit Delta in the zoo.

clear(**kwargs) None[source]

Resets synapses to their resting state.

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:

torch.Tensor

Important

The first tensor of *inputs will represent the input spikes. Any subsequent tensors will be treated as injected current. These must be broadcastable with current.

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 to 0.0.

  • spike_overbound (bool | None, optional) – value to replace spikes out of bounds, uses values at observation limits if None. Defaults to False.

  • inplace (bool) – if write operations on RecordTensor attributes should be performed with in-place operations. Defaults to False.

Returns:

partial constructor for synapse.

Return type:

SynapseConstructor