CurrentDerivedSpikeMixin

class CurrentDerivedSpikeMixin(currents: Tensor, to_spikes: Callable[[InfernoSynapse, dtype, device, Tensor], Tensor], interp: Interpolation, interp_kwargs: dict[str, Any], current_overbound: float | None, spike_overbound: bool | None, tolerance: float)[source]

Bases: CurrentMixin

Mixin for synapses with current and spikes derived therefrom.

Parameters:
  • currents (torch.Tensor) – initial synaptic currents, in \(\text{nA}\).

  • to_spikes (Callable[[InfernoSynapse, torch.dtype, torch.device, torch.Tensor], torch.Tensor]) – function which takes the synapse, data type, device, and a tensor of currents, and returns the corresponding spikes.

  • interp (Interpolation) – interpolation function used when selecting prior currents and spikes derived therefrom.

  • interp_kwargs (dict[str, Any]) – keyword arguments passed into the interpolation function.

  • current_overbound (float | None) – value to replace currents out of bounds, uses values at observation limits if None.

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

  • tolerance (float) – maximum difference in time from an observation to treat as co-occurring, in \(\text{ms}\).

property spike: Tensor

Spike input to the synapses at present.

Parameters:

value (torch.Tensor) – new spike input.

Returns:

present spike input.

Return type:

torch.Tensor

Note

The setter does nothing as spikes are derived from currents.

spike_at(selector: Tensor) Tensor[source]

Retrieves previous spike inputs.

Parameters:

selector (torch.Tensor) – time before present for which spike inputs should be retrieved, in \(\text{ms}\).

Returns:

selected spike inputs.

Return type:

torch.Tensor

Shape

selector:

\(B \times N_0 \times \cdots \times [D]\)

return:

\(B \times N_0 \times \cdots \times [D]\)

Where:
  • \(B\) is the batch size.

  • \(N_0 \times \cdots\) is the shape of the synapse.

  • \(D\) is the number of selectors per synapse.