stimuli Package

This sub-package contains modules that are related to definition and manipulation of stimuli.

Modules

  • 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.

stimuli Module

This module defines the API for:
  • implementation of stimuli as input to models (see class BaseStimulus)
  • identification of stimulus identity
  • function helpers for common manipulation with collections of stimuli

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.

class mozaik.stimuli.__init__.BaseStimulus(**params)

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:
 
frame_duration : SNumber(bounds=None, constant=False, default=None, inclusive_bounds=(True, True), period=None, readonly=False, units=1 ms (millisecond))

The duration of single frame

trial : SInteger(bounds=None, constant=False, default=None, inclusive_bounds=(True, True), period=None, readonly=False, units=None)

The trial of the stimulus

duration : SNumber(bounds=None, constant=False, default=None, inclusive_bounds=(True, True), period=None, readonly=False, units=1 ms (millisecond))

The duration of stimulus

direct_stimulation_name : SString(constant=False, default=None, period=None, readonly=False, units=None)

The name of the artifical stimulation protocol

number_of_parameters()

Returns number of parameters of the stimulus.

frames()

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.

update()

Sets the current frame to the next frame in the sequence.

reset()

Reset to the first frame in the sequence.

export(path=None)

Save the frames to disk. Returns a list of paths to the individual frames.

path - the directory in which the individual frames will be saved. If
path is None, then a temporary directory is created.
class mozaik.stimuli.__init__.InternalStimulus(**params)

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.

Previous topic

vision Package

Next topic

vision Package

This Page