This sub-package contains modules that are related to definition and manipulation of stimuli.
- mozaik.stimuli.stimulus - contains definition of the stimulus API
- mozaik.stimuli.visual_stimulus - contains definitions of the visual stimulus API, and implements some of the functions specified in the stimulus interface
- mozaik.stimuli.topographica_based - contains implementation of number of visual stimuli, using the Topographica pattern generation package.
See the mozaik.stimuli.stimulus for more general information on stimulus handling in mozaik.
Each stimulus is expected to have a list of parameters which have to uniquely identify the stimulus. This parameterization is done via the MozaikParametrized package (see mozaik.tools.mozaik_parametrized.MozaikParametrized) that allows to specify parameters with the all above requirements. For Stimuli objects we will allow only SNumber, SInteger and SString parameter types (see mozaik.tools.mozaik_parametrized). These extend the corresponding parameterized parameters to allow specification of units.
Note that each stimulus can be converted back and forth into a string via the str operator and the mozaik.tools.mozaik_parametrized.MozaikParametrized.idd() function. This allows for efficient storing and manipulation of stimulus identities.
Note that all such parameters defined in the class (and its ancestors) will be considered as parameters of the BaseStimulus.
Bases: mozaik.tools.mozaik_parametrized.MozaikParametrized
The abstract stimulus class. It defines the parameters common to all stimuli and the list of function each stimulus has to provide.
Mozaik parameters: | |
---|---|
|
Returns number of parameters of the stimulus.
Return a generator which yields the frames of the stimulus in sequence. Each frame is returned as a tuple (frame, variables) where frame is a numpy array containing the stimulus at the given time and variables is a list of variable values (e.g., orientation) associated with that frame.
See topographica_based for examples.
Sets the current frame to the next frame in the sequence.
Reset to the first frame in the sequence.
Save the frames to disk. Returns a list of paths to the individual frames.
Bases: mozaik.stimuli.__init__.BaseStimulus
This is a very specific case of stimulus. It is used exclusively in the case the model does not have any sensory stimulus (and consequently input space). In such case it is still possible to stimulate the network ‘artifically’ via the Experiment’s direct stimulation facilities (see exc_spike_stimulators etc. in Experiment class).
In such case this stimulus should be associated with the experiment, as it will allow for all the other parts of mozaik to work consistently, and will be useful in that it will record the duration of the experiment, the possible information about multiple trials, and the identity of the artificialy stimulation used. Note that in that case the frame_duration should be set to duration time.