docstring goes here
A slimmed-down version of http://www.scipy.org/scipy/numpy/attachment/ticket/966/meshgrid.py
scale_factor = pixel/degree
x, y, and t should all be 3D arrays, produced by meshgrid3D. If we need to optimize, it would be quicker to do G() on a 1D t array and F_2d() on 2D x and y arrays, and then multiply them, as Jens did in his original implementation. Timing gives 0.44 s for Jens’ implementation, and 2.9 s for this one.
Retina/LGN model based on that developed by Jens Kremkow (CNRS-INCM/ALUF)
A slimmed-down version of http://www.scipy.org/scipy/numpy/attachment/ticket/966/meshgrid.py
Bases: object
Implements spatio-temporal receptive field.
Parameters : | func : function
func_params : ParameterSet
width : float (degrees)
height : float (degrees)
duration : float (ms)
|
---|
Notes
Coordinates x = 0 and y = 0 are at the centre of the spatial kernel.
Quantizes the the receptive field.
Parameters : | dx : float
dy : float
dy : float
|
---|
Notes
If dx does not divide exactly into the width, then the actual width will be slightly larger than the nominal width. dx and dy should be in degrees and dt in ms.
Bases: object
A model of the input current to an LGN relay cell, that multiplies, in space and time, the luminance values impinging on its receptive field by a spatiotemporal kernel. Spatial summation over the result of this multiplication at each time point gives a current in nA, that may then be injected into a relay cell.
initialize() should be called once, before stimulus presentation view() should be called in a loop, once for each stimulus frame response_current() should be called at the end of stimulus presentation
Parameters : | x , y : float
receptive_field : SpatioTemporalReceptiveField
gain : float
visual_space : VisualSpace
|
---|
Create the array that will contain the current response, and set the initial values on the assumption that the system was looking at a blank screen of constant luminance prior to stimulus onset.
Parameters : | background_luminance : float
stimulus_duration : float (ms)
|
---|
Look at the visual space and update t Where the kernel temporal resolution is the same as the frame duration (visual space update interval):
- R_i = Sum[j=0,L-1] K_j.I_i-j
- where L is the kernel length/duration
To avoid loading the entire image sequence into memory, we build up the response array one frame at a time.
Multiply the response (units of luminance (cd/m²) if we assume the kernel values are dimensionless) by the ‘gain’, to produce a current in nA. Returns a dictionary containing ‘times’ and ‘amplitudes’. Might be better to use a NeuroTools AnalogSignal.
Bases: mozaik.core.SensoryInputComponent
Retina/LGN model with spatiotemporal receptive field.
Parameters : | density : int (1/degree^2)
size : tuple (degree,degree)
linear_scaler : float
cached : bool
cache_path : str
mpi_reproducible_noise : bool
recorders : : |
---|
Notes
If the stimulus is cached SpatioTemporalFilterRetinaLGN will write in the local directory parameters.cache_path the generated amplitudes for all the neurons in the retina (so this will be specific to the model) for each new presented stimulus. If it is asked to generate activities for a stimulus that already exists in the directory (it just checks for the name and parameter values of the stimulus, except trail number) it will retrieve the values from the cahce. Note that the input currents are stored without the noise and the aditional noise is still applied after retrieval so the actual current injected into the retinal neurons will not be identical to the one that was injected when the stimulus was saved in the cache.
IMPORTANT This mechanism assumes that the retinal model stays otherwise identical between simulations. The moment anything is changed in the retinal model one has to delete the retina_cache directory (which effectively resets the cache).
Returns the cached calculated responses due to stimulus corresponding to stimulus_id.
Parameters : | stimulus_id : StimulusID
|
---|---|
Returns : | Tuple (input_currents, retinal_input) where input_currents are the currents due to the RFs of the individual RFs and retinal_input is the : list of frames shown to the retina. : |
Stores input currents and the retinal input corresponding to a given stimulus.
Parameters : | stimulus_id : StimulusID
|
---|
Present a visual stimulus to the model, and create the LGN output (relay) neurons.
Parameters : | visual_space : VisualSpace
stimulus : VisualStimulus
duration : int (ms)
offset : int(ms)
|
---|---|
Returns : | retinal_input : list(ndarray)
|
This function exists for optimization purposes. It is the analog to :func:.`mozaik.retinal.SpatioTemporalFilterRetinaLGN.process_input` for the special case when blank stimulus is shown.
Parameters : | visual_space : VisualSpace
duration : int (ms)
offset : int(ms)
|
---|---|
Returns : | retinal_input : list(ndarray)
|