"The values assigned for the following parameters are kept the same as in the paper except for the `scale_down_to` which is set as 0.006 enabling to simulate a down-scaled multi-area model with 2GB RAM. By default, it's set as 1.0 for simulating the full-scame model."
"The values assigned for the following parameters are kept the same as in the paper except for the `scale_down_to` which is set as 0.006 enabling to simulate a down-scaled multi-area model with 2GB RAM. By default, it is set to 1.0 for simulating the full-scale model."
The code in this notebook implements the down-scaled version of spiking network model of macaque visual cortex developed at the Institute of Neuroscience and Medicine (INM-6), Research Center Jülich. The full-scale model has been documented in the following publications:
1. Schmidt M, Bakker R, Hilgetag CC, Diesmann M & van Albada SJ
Multi-scale account of the network structure of macaque visual cortex
Brain Structure and Function (2018), 223: 1409 [https://doi.org/10.1007/s00429-017-1554-4](https://doi.org/10.1007/s00429-017-1554-4)
2. Schuecker J, Schmidt M, van Albada SJ, Diesmann M & Helias M (2017)
Fundamental Activity Constraints Lead to Specific Interpretations of the Connectome.
The values assigned for the following parameters are kept the same as in the paper except for the `scale_down_to` which is set as 0.006 enabling to simulate a down-scaled multi-area model with 2GB RAM. By default, it's set as 1.0 for simulating the full-scame model.
The values assigned for the following parameters are kept the same as in the paper except for the `scale_down_to` which is set as 0.006 enabling to simulate a down-scaled multi-area model with 2GB RAM. By default, it is set to 1.0 for simulating the full-scale model.
1.`scale_down_to` is the down-scaling factor that defines the ratio by which the full-scale multi-area model is reduced to a model with fewer neurons and indegrees. This reduction is essential to enable simulation on machines with limited computational power, ensuring that simulation results can be obtained in a relatively shorter timeframe. <br> If the value is `scale_down_to = 1.`, the full-scale network will be simulated. <br> In the pre-set down-scaled version, `scale_down_to = 0.006`. This setting reduces the number of neurons and indegrees to 0.6 % of their full-scale counterparts, facilitating simulation on a typical local machine. <br>**Warning**: This may not yield reasonable results from the network dynamics and is only meant to demonstrate the simulation workflow! <br>
2.`cc_weights_factor` is the scaling factor that controls the cortico-cortical synaptic strength. <br> By default it is set to `1.9`, keeping the same value for producing the metastable state as in the original paper. <br>**Important**: This factor plays a crucial role in transitioning the network activity from the ground to the metastable state. In the full-scale network, the ground state and metastable state activities are achieved when this parameter is set to `1.0` and `1.9`, respectively.<br>
3.`areas_simulated` specifies the cortical areas to be included in the simulation process. Its default value is `complete_area_list` meaning all the areas in the complete_area_list will be simulated.
The value assigned to `areas_simulated` can be any sublist of complete_area_list.
4.`replace_non_simulated_areas` defines how non-simulated areas will be replaced. <br> When all areas are included, it is set as `None` by default. <br> Other options are: `'hom_poisson_stat'`, `'het_poisson_stat'`, and `'het_current_nonstat'`.<br>`'hom_poisson_stat'` replaces the non-simulated areas by Poisson sources with the same global rate `rate_ext`. The `'het_poisson_stat'` and `'het_current_nonstat'` options use the loaded specific rates from `'replace_cc_input_source'`, which contains the area-specific firing rates of our full-scale simulation results. The difference is that `'het_poisson_stat'` replaces the non-simulated areas by Poisson spike trains and `'het_current_nonstat'` replaces it with a time-varying current input.
5.`g` defines the relative inhibitory synaptic strength (in relative units to the excitatory synaptic strength). By default: `-11.0`, as used in the full-scale network. `g = -1.0` means equal excitatory and inhibitory strengths, and `g < -1.0` results in stronger inhibition than excitation.
6.`rate_ext` defines the rate of the Poissonian spike generator (in spikes/s), by default: `10.0`. It also serves as one of the input parameters of the model. When a larger value is assigned to `rate_ext`, the excitatory background noise is increased. Note that the external Poisson indegree onto 5E and 6E is increased by a factor of 1.125 and 1.41666667 repectively, and the external Poisson indegree onto 23E and 5E in area TH is increased by a factor of 1.2.
%% Cell type:code id:60265d52 tags:
``` python
# Downscaling factor
# value range/options: (0, 1.], change it to 1. to simulate the full-scale network
scale_down_to=0.006
# Scaling factor for cortico-cortical connections (Chi)
# value range/options: [1., 2.5],
# a weight factor of 1.0 produces Ground state activity.
# 1.9 was assigned to produce results in Schmidt et al. (2018).
cc_weights_factor=1.9
# Cortical areas included in the simulation
# value range/options: any sublist of complete_area_list
We try our best not to confuse users with too many parameters. So, the few parameters tunned will be automatically assigned in this section to properly run the simulation.
However, if you want to explore the model, you can alter other parameters related to the network or simulation configuration by passing them in the `network_params` and `sim_params` dictionaries below. If this is not the case, you can execute the cell the way it is.
raiseException("'hom_poisson_stat', 'het_poisson_stat', or 'het_current_nonstat' should be assigned to replace_non_simulated_areas when not all areas are simulated!")
# Determine cc_weights_I_factor from cc_weights_factor
ifcc_weights_factor==1.0:# For ground state with cc_weights_factor as 1.,
cc_weights_I_factor=1.0# cc_weights_I_factor is set to 1.
elifcc_weights_factor>1.0andcc_weights_factor<=2.5:# For cc_weights_factor in (1., 2.5],
cc_weights_I_factor=2.0# cc_weights_I_factor is set to 2.
else:# cc_weights_factor outside of (1., 2.5], raise error
raiseException("A value in range [1.0, 2.5] should be assigned to the parameter cc_weights_factor!")
# Connection parameters
conn_params={
'replace_non_simulated_areas':replace_non_simulated_areas,# Whether to replace non-simulated areas by Poisson sources
'g':g,# It sets the relative inhibitory synaptic strength, by default: -11.
'replace_cc_input_source':replace_cc_input_source,# Specify the data used to replace non-simulated areas
'cc_weights_factor':cc_weights_factor,
'cc_weights_I_factor':cc_weights_I_factor
}
# Input parameters
input_params={
'rate_ext':rate_ext# Rate of the Poissonian spike generator (in spikes/s), by default: 10.
}
# Network parameters
network_params={
'N_scaling':scale_down_to,# Scaling of population sizes, by default: 1. for full scale multi-area model
'K_scaling':scale_down_to,# Scaling of indegrees, by default: 1. for full scale multi-area model
'fullscale_rates':os.path.join(base_path,'tests/fullscale_rates.json'),# Absolute path to the file holding full-scale rates for scaling synaptic weights, by default: None
The inter-areal connectivity of the model is expressed as the relative indegrees for each target area. The relative indegrees for each target area are calculated as following: the value in the cell showing the stregnth of connection from a source area to a target area is calculated as the indegree from the source area to the target area divided by the sum of all indegrees to the target area.
%% Cell type:markdown id:8a7c09e0 tags:
The connectivity and neuron numbers are stored in the attributes of the model class.
- Neuron numbers of all populations in each area are stored in `M.N` as a dictionary (and in `M.N_vec` as an array).
- Indegrees are stored in `M.K` as a dictionary (and in `M.K_matrix` as an array).<br>
**Reminder**: The spike trains of simulated results are saved to the folder with path `./simulations/<simulation_label>/recordings` where the `<simulation_label>` is displayed in the output of 2.2. All statistics describing network dynamics are computed from the saved spike trains.
%% Cell type:markdown id:fd6e3232 tags:
Go back to [Notebook Outline](#toc)
%% Cell type:markdown id:bb71c922 tags:
## S3. Visualization of Network Dynamics <a class="anchor" id="section_3"></a>
**Important**: `cc_weights_factor` plays a crucial role in transitioning the network activity from the ground to the metastable state. In the full-scale network, the ground state and metastable state activities are achieved when this parameter is set to `1.0` and `1.9`, respectively.
An overview of time-averaged firing rate over simulated populations encoded in colors with areas along x-axis and populations along y-axis. The cells of population 4E and 4I in area TH are labeled with X as area TH does not have layer 4.
Comparison of area-level functional connectivity (FC) between the down-scaled MAM and macaque experimental data. (A) Simulated FC measured by the zero-time-lag correlation coefficient of synaptic input currents. (B) FC of macaque resting-state fMRI (see Materials and methods).
The spike data of all simulated populations for all simulations are saved in `./simulations/<simulation_label>/recordings` where `<simulation_label>` can be accessed in the output of 2.2. Or users can see their latest simulation by checking the column "Last Modified" and find the folder with the latest change.
2. Statistics <br>
The statistics of network dynamics computed from the spike trains can be found in `./simulations/<simulation_label>/Analysis`. You may also find more statistics defined in `./multiarea_model/analysis.py` to explore more about network dynamics.
3. Scripts for visualizing network dynamics <br>
The scripts for computing statistics and plotting the figures in S3 can be found in `./figures/MAM2EBRAINS`.