.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/gif_population.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_gif_population.py: Population of GIF neuron model with oscillatory behavior -------------------------------------------------------- This script simulates a population of generalized integrate-and-fire (GIF) model neurons driven by noise from a group of Poisson generators. Due to spike-frequency adaptation, the GIF neurons tend to show oscillatory behavior on the time scale comparable with the time constant of adaptation elements (stc and sfa). Population dynamics are visualized by raster plot and as average firing rate. References ~~~~~~~~~~ .. [1] Schwalger T, Degert M, Gerstner W (2017). Towards a theory of cortical columns: From spiking neurons to interacting neural populations of finite size. PLoS Comput Biol. https://doi.org/10.1371/journal.pcbi.1005507 .. [2] Mensi S, Naud R, Pozzorini C, Avermann M, Petersen CC and Gerstner W (2012). Parameter extraction and classification of three cortical neuron types reveals two distinct adaptation mechanisms. Journal of Neurophysiology. 107(6), pp.1756-1775. .. GENERATED FROM PYTHON SOURCE LINES 49-50 Import all necessary modules for simulation and plotting. .. GENERATED FROM PYTHON SOURCE LINES 50-57 .. code-block:: default import nest import nest.raster_plot import matplotlib.pyplot as plt nest.ResetKernel() .. GENERATED FROM PYTHON SOURCE LINES 58-59 Assigning the simulation parameters to variables. .. GENERATED FROM PYTHON SOURCE LINES 59-63 .. code-block:: default dt = 0.1 simtime = 2000.0 .. GENERATED FROM PYTHON SOURCE LINES 64-66 Definition of neural parameters for the GIF model. These parameters are extracted by fitting the model to experimental data [2]_. .. GENERATED FROM PYTHON SOURCE LINES 66-83 .. code-block:: default neuron_params = {"C_m": 83.1, "g_L": 3.7, "E_L": -67.0, "Delta_V": 1.4, "V_T_star": -39.6, "t_ref": 4.0, "V_reset": -36.7, "lambda_0": 1.0, "q_stc": [56.7, -6.9], "tau_stc": [57.8, 218.2], "q_sfa": [11.7, 1.8], "tau_sfa": [53.8, 640.0], "tau_syn_ex": 10.0, } .. GENERATED FROM PYTHON SOURCE LINES 84-85 Definition of the parameters for the population of GIF neurons. .. GENERATED FROM PYTHON SOURCE LINES 85-90 .. code-block:: default N_ex = 100 # size of the population p_ex = 0.3 # connection probability inside the population w_ex = 30.0 # synaptic weights inside the population (pA) .. GENERATED FROM PYTHON SOURCE LINES 91-93 Definition of the parameters for the Poisson group and its connection with GIF neurons population. .. GENERATED FROM PYTHON SOURCE LINES 93-98 .. code-block:: default N_noise = 50 # size of Poisson group rate_noise = 10.0 # firing rate of Poisson neurons (Hz) w_noise = 20.0 # synaptic weights from Poisson to population neurons (pA) .. GENERATED FROM PYTHON SOURCE LINES 99-101 Configuration of the simulation kernel with the previously defined time resolution. .. GENERATED FROM PYTHON SOURCE LINES 101-104 .. code-block:: default nest.resolution = dt .. GENERATED FROM PYTHON SOURCE LINES 105-107 Building a population of GIF neurons, a group of Poisson neurons and a spike recorder device for capturing spike times of the population. .. GENERATED FROM PYTHON SOURCE LINES 107-114 .. code-block:: default population = nest.Create("gif_psc_exp", N_ex, params=neuron_params) noise = nest.Create("poisson_generator", N_noise, params={'rate': rate_noise}) spike_det = nest.Create("spike_recorder") .. GENERATED FROM PYTHON SOURCE LINES 115-118 Build connections inside the population of GIF neurons population, between Poisson group and the population, and also connecting spike recorder to the population. .. GENERATED FROM PYTHON SOURCE LINES 118-128 .. code-block:: default nest.Connect( population, population, {'rule': 'pairwise_bernoulli', 'p': p_ex}, syn_spec={"weight": w_ex} ) nest.Connect(noise, population, 'all_to_all', syn_spec={"weight": w_noise}) nest.Connect(population, spike_det) .. GENERATED FROM PYTHON SOURCE LINES 129-130 Simulation of the network. .. GENERATED FROM PYTHON SOURCE LINES 130-133 .. code-block:: default nest.Simulate(simtime) .. GENERATED FROM PYTHON SOURCE LINES 134-136 Plotting the results of simulation including raster plot and histogram of population activity. .. GENERATED FROM PYTHON SOURCE LINES 136-140 .. code-block:: default nest.raster_plot.from_device(spike_det, hist=True) plt.title('Population dynamics') plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.000 seconds) .. _sphx_glr_download_auto_examples_gif_population.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: gif_population.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: gif_population.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_