RegularStimulus

class spikeometric.stimulus.RegularStimulus(strength: float, period: int, tau: int, stop: int, stimulus_masks: torch.Tensor, batch_size: int = 1, start: int = 0, dt: float = 1.0)[source]

Bases: spikeometric.stimulus.base_stimulus.BaseStimulus

Regular stimulus of neurons with period of \(T\) time steps and a duration \(\tau\) time steps for each stimulus event. The stimulus is constant at \(s\) during the stimulus events and zero otherwise. The first stimulus event starts at time step \(t_0\) and the stimulus ends at time step \(t_s\).

Parameters
  • strength (float) – Strength \(s\) of the stimulus.

  • period (int) – period \(T\) of the stimulus

  • tau (int) – Duration \(\tau\) of each stimulus event

  • stop (int) – Stop time \(t_s\) of the stimulus

  • stimulus_mask (torch.Tensor[bool]) – A mask of shape (n_neurons,) indicating which neurons to stimulate.

  • batch_size (int) – Number of networks to stimulate in parallel.

  • start (int) – Start time \(t_0\) of the first stimulus event

  • dt (float) – Time step \(\Delta t\) of the simulation in ms.

__call__(t: Union[float, torch.Tensor]) torch.Tensor[source]

Computes the stimulus at time step \(t\). The stimulus is constant at \(s\) during the stimulus events and zero otherwise.

Parameters

t (torch.Tensor) – Time \(t\) at which to compute the stimulus (ms).

Returns

Stimulus at time \(t\).

Return type

torch.Tensor