You can run the model itself, specifying various parameters, or you can run
pre-cooked analyses that were used as the basis of figures in the paper.
Running the model
Start IPython in -pylab mode:
$ ipython -pylab
Then, import the libraries and create a model instance:
In [0]: from grid_remap import *
In [1]: model = PlaceNetworkStd()
To see all the user-settable parameters, you can print the model:
In [2]: print model
PlaceNetworkStd(Model) object
--------------------------------
Parameters:
C_W : 0.33000000000000002
EC : None
J0 : 45.0
N_CA : 500
done : False
dwell_factor : 5.0
monitoring : True
mu_W : 0.5
pause : False
phi_lambda : 0.040000000000000001
phi_sigma : 0.02
refresh_orientation : False
refresh_phase : False
refresh_traj : False
refresh_weights : True
tau_r : 0.050000000000000003
traj_type : 'checker'
Important model parameter definitions:
C_W feedforward connectivity
EC the GridCollection to use as input
J0 gain of global inhibition
N_CA the number of output units; each receives input from
C_W*N_EC grid cells
dwell_factor multiple of tau_r that defines raster pixel dwell time
mu_W average weight of feedforward synapses
phi_lambda nonlinearity threshold
phi_sigma nonlinearity smoothness (gain)
refresh_* orientation/phase reset per trial; new random weight
matrix per trial
tau_r time constant of place-unit integration
Parameters can be changed by passing them as keyword arguments to the
constructor. To simulate only 100 place units, you would call
PlaceNetworkstd(N_CA=100).
Run the simulation:
In [3]: model.advance()
Look at the tracked data:
In [4]: pmap = CheckeredRatemap(model)
Running analyses
To run the figure analyses, you simply create an analysis object and run it by
calling it with analysis parameters. To run progressive realignment
experiments using the RealignmentSweep analysis class, you would run:
In [20]: fig = RealignmentSweep(desc='test')
In [21]: fig.collect_data?
The first command creates an analysis object with the description 'test'. The
second command (with the ?) tells IPython to print out meta-data about the
collect_data method. This is the method that actually performs the analysis
when you call the object, so this tells you the available parameters along with
their descriptions. We could run the analysis with modularity on the y-axis:
In [22]: fig(y_type='modules')
This performs the simulations, collects data for the figures, and stores data,
statistics, and an analysis.log file in the analysis directory. When that
completes, you can bring up the resulting figure and save it:
In [23]: fig.view()
In [24]: fig.save_plots()
Running the view method renders the figures, outputs RGB image files, and
saves a figure.log file in the analysis directory. Some of the figures have
parameter arguments to change the figure. You will have to use the
create_plots method, as this is what the view method actually calls. To
see the figure parameters and make changes:
In [25]: fig.create_plots?
In [26]: fig.create_plots(...)
The same process can be used for the other figure analysis classes. You can
create your own analyses by subclassing from core.analysis.BaseAnalysis and
implementing the collect_data and create_plots methods.
Please explore the code, and let me know at jmonaco@jhu.edu if there are any major issues. There are no guarantees
that this code will work perfectly everywhere.
Enjoy.