sim_tools.
run_model
(V0, Z0, DA0, task, outfile, seed=None, paramfile='parameters.py', symsyn=True, verbose=True, ram_use=0.2, **kwargs)[source]¶Run a simulation using the neural population model
Parameters: | V0 : NumPy 1darray
Z0 : NumPy 1darray
DA0 : NumPy 1darray
task : str
outfile : str
seed : int
paramfile : str
symsyn : bool
verbose : bool
ram_use : float
kwargs : additional keyword arguments
|
---|---|
Returns: | Nothing : None
|
See also
plot_sim
Notes
Due to the (usually) high temporal resolution of simulations, results are not kept in memory (and thus returned as variable in the caller’s work-space) but saved directly to disk using the HDF5 container outfile. The code uses the HDF library’s data chunking feature to save entire segments on disk while running. By default the code will allocate around 20% of available memory to cache simulation results. Hence, more memory leads to fewer disk-writes during run-time and thus faster performance. The structure of the generated output container is as follows: all state variables and the dopaminergic gain Beta are stored at the top-level of the file. Additionally, the employed coupling matrix C and dopamine connection matrix D are also saved in the top level group. All used parameters are saved in the subgroup params.
References
[R12] | S. Fuertinger, J. C. Zinn, and K. Simonyan. A Neural Population Model Incorporating Dopaminergic Neurotransmission during Complex Voluntary Behaviors. PLoS Computational Biology, 10(11), 2014. |
Examples
Let V0, Z0, and DA0 (NumPy 1darrays of length N) be initial conditions of the model. Assuming that a valid parameter file (called parameters.py) is located in the current working directory, the following call will run a resting state simulation and save the output in the HDF5 container sim_rest.h5
>>> run_model(V0,Z0,DA0,'rest','sim_rest.h5')
Assume another parameter file, say, par_patho.py hold parameter settings simulating a certain pathology. Then the command
>>> run_model(V0,Z0,DA0,'rest','patho/sim_rest_patho.h5',paramfile='par_patho.py')
runs a resting state simulation with the same initial conditions and saves the result in the container sim_rest_patho.h5 in the sub-directory patho (which must already exist, otherwise an error is raised).
If only one or two parameters should be changed from their values found in a given parameter file, it is probably more handy to change the value of these parameters from the command line, rather than to write a separate parameter file (that is identical to the original one except for two values). Thus, assume the values of VK and VL should be -0.4 and -0.9 respectively, i.e., different than those found in (the otherwise fine) par_patho.py. Then the command
>>> run_model(V0,Z0,DA0,'rest','patho/sim_rest_patho.h5',paramfile='par_patho.py',VK=-0.4,VL=-0.9)
runs the same resting state simulation as above but with VK=-0.4 and VL=-0.9. This feature can also be used to efficiently embed run_model in a parameter identification framework.