.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/run_mean_field_theory.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_run_mean_field_theory.py: Run mean-field theory ------------------------ This example script shows a mean-field theoretical analysis using for network parameters using NNMT - the Neuronal Network Meanfield Toolbox (https://github.com/INM-6/nnmt). .. GENERATED FROM PYTHON SOURCE LINES 8-16 .. code-block:: Python import os import numpy as np from mesocircuit import mesocircuit_framework as mesoframe import parametersets import nnmt import mesocircuit.plotting.figures as figures .. GENERATED FROM PYTHON SOURCE LINES 17-19 We instantiate a MesocircuitExperiment with one circuit and use its parameters for creating an NNMT network object. .. GENERATED FROM PYTHON SOURCE LINES 19-35 .. code-block:: Python name = 'microcircuit_MAMV1' # reference model # name = 'microcircuit_PD' # Potjans & Diesmann (2014) microcircuit # upscaled model does not work well because theory does not account for space # name = 'mesocircuit_MAMV1' custom_params = parametersets.ps_dicts[name] meso_exp = mesoframe.MesocircuitExperiment(name, custom_params) circuit = meso_exp.circuits[0] # NNMT network object of type Microcircuit nw = nnmt.models.Microcircuit( network_params=os.path.join( circuit.data_dir_circuit, 'parameters', 'nnmt_dict.yaml'), analysis_params='nnmt_analysis_params.yaml') .. GENERATED FROM PYTHON SOURCE LINES 36-38 We calculate the working point, the transfer function, power spectra, and the sensitivity measure. .. GENERATED FROM PYTHON SOURCE LINES 38-56 .. code-block:: Python # working point for exponentially shaped post synaptic currents wp = nnmt.lif.exp.working_point(nw) print(wp) # transfer function nnmt.lif.exp.transfer_function(nw) # delay distribution matrix nnmt.network_properties.delay_dist_matrix(nw) # effective connectivity matrix nnmt.lif.exp.effective_connectivity(nw) # power spectra power = nnmt.lif.exp.power_spectra(nw) freqs = nw.analysis_params['omegas'] / (2. * np.pi) # sensitivity measure sensitivity_dict = nnmt.lif.exp.sensitivity_measure_all_eigenmodes(nw) .. GENERATED FROM PYTHON SOURCE LINES 57-58 The results are plotted as an overview figure. .. GENERATED FROM PYTHON SOURCE LINES 58-65 .. code-block:: Python figures.theory_overview( circuit=circuit, working_point=wp, frequencies=freqs, power=power, sensitivity=sensitivity_dict) .. _sphx_glr_download_auto_examples_run_mean_field_theory.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: run_mean_field_theory.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: run_mean_field_theory.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: run_mean_field_theory.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_