models Package

This package defines the API for model definition in mozaik, and the mozaik.models.retinal subpackage contains implementations for models of retina.

models Module

This module contains the implementation of a Model API.

Each simulation contains one model, that overarches the neural network that has been built using the basic mozaik components (sheets and connectors) and some additional structures such as the recording configurations.

class mozaik.models.__init__.Model(sim, num_threads, parameters)

Bases: mozaik.core.BaseComponent

Model encapsulates a mozaik model.

Each mozaik model has to derive from this class, and in its constructor it has to construct the model from the basic mozaik building blocks (sheets and connectors), and set the variable input_layer to the sheet corresponding to the sensory input sheet.

Other Parameters:
 

name : str

The name of the model.

results_dir : str

Path to a directory where to store the results.

rest : bool

If True the pyNN.reset() is used to reset the network between stimulus presentations. Otherwise a blank stimulus is shown for a period of time defined by the parameter null_stimulus_period.

null_stimulus_period : float

The length of blank stimulus presentation during the simulation.

input_space : ParameterSet

The parameters for the InputSpace object that will become the sensory input space for the model.

input_space_type : str

The python class of the InputSpace object to use.

required_parameters = {'reset': <type 'bool'>, 'input_space': <class 'parameters.ParameterSet'>, 'name': <type 'str'>, 'results_dir': <type 'str'>, 'input_space_type': <type 'str'>, 'null_stimulus_period': <type 'float'>}
present_stimulus_and_record(stimulus, artificial_stimulators)

This method is the core of the model execution control. It ensures that a stimulus is presented to the model, the simulation is ran for the duration of the stimulus, and all the data recorded during this period are retieved from the simulator. It also makes sure a blank stimulus preceds each stimulus presntation.

Parameters :

stimulus : Stimulus

Stimulus to be presented.

artificial_stimulators : dict

Dictionary where keys are sheet names, and values are lists of DirectStimulator instances to be applied in the corresponding sheet.

Returns :

segments : list

List of segments holding the recorded data, one per each sheet.

sensory_input : object

The ‘raw’ sensory input that has been shown to the network - the structure of this object depends on the sensory component.

sim_run_time : float (seconds)

The biological time of the simulation up to this point (including blank presentations).

run(tstop)

Run’s the simulation for tstop time.

Parameters :

tstop : float (seconds)

The duration for which to run the simulation.

Returns :

time : float (seconds)

The wall clock time for which the simulator ran.

reset()

Rests the network. Depending on the self.parameters.reset this is done either by using the pyNN reset function or by presenting a blank stimulus for self.parameters.null_stimulus_period seconds.

register_sheet(sheet)

This functions has to called to add a new sheet is added to the model.

register_connector(connector)

This functions has to called to add a new connector to the model.

neuron_ids()

Returns the list of ids of neurons in the model.

neuron_positions()

Returns the positions of neurons in the model. The positions are return as a dictionary where each key corresponds to a sheet name, and the value contains a 2D array of size (2,number_of_neurons) containing the x and y coordinates of the neurons in the given sheet.

neuron_annotations()

Returns the neuron annotations, as a dictionary with sheet names as keys, and corresponding annotation dictionaries as values.

Previous topic

sheets Package

Next topic

vision Package

This Page