BaseStimulus

class spikeometric.stimulus.BaseStimulus(*args, **kwargs)[source]

Bases: torch.nn.modules.module.Module

Base class for stimuli. This class implements the logic for switching between batches of stimuli for simulations with batched networks.

property stimulus_masks

Returns the batched stimulus masks.

batch_stimulus_masks(stimulus_masks: list, batch_size: int) list[source]

Batches the stimulus masks into batches of size batch_size, concatenates them, and returns the concatenated stimulus masks and the split points.

property current_batch

Returns the current batch of stimuli.

reset()[source]

Resets the stimulus to the first batch.

next_batch()[source]

Switches to the next batch of stimuli.

set_batch(idx: int)[source]

Switches to the batch of stimuli with the given index.

Parameters

idx (int) – Index of the batch to switch to.