A sparsely connected recurrent network

We simlulate the model proposed in Brunel (2000). http://link.springer.com/article/10.1023/A:1008925309027

Network Composition

  1. A population of excitatory neurons (Number of neurons, N_e = 8000)
  2. A population of inhibitory neurons (Number of neurons, N_i = 2000)
  3. Independent poisson processes to mimic outside acivity

Import libraries and prepare nest for new simulation

Setup

  • Ensure that PYTHONPATH includes the nest installation directory
  • Import python numeric and plotting libraries
  • Reset the nest kernel to begin with a clean slate

In [1]:
import sys
sys.path.append('/opt/lib/python2.7/site-packages/')

In [2]:
import numpy as np
import pylab

import nest
import nest.raster_plot
nest.ResetKernel()

Enable multi-threading. Set number of threads equal to the number of processor cores (e.g. 8 for intel i7)

This enables the nest simualtor to use multiple processor cores resulting in faster simulation.


In [3]:
nest.SetKernelStatus({'local_num_threads': 8})

Population sizes


In [4]:
total_population = 10000

pop_e = 0.8*total_population
pop_i = 0.2*total_population

Neuron Models

Nest supports a large number of neuron types. They can be viewed using:


In [5]:
nest.Models('nodes')


Out[5]:
(u'ac_generator',
 u'aeif_cond_alpha',
 u'aeif_cond_alpha_RK5',
 u'aeif_cond_alpha_multisynapse',
 u'aeif_cond_exp',
 u'amat2_psc_exp',
 u'correlation_detector',
 u'correlomatrix_detector',
 u'dc_generator',
 u'gamma_sup_generator',
 u'ginzburg_neuron',
 u'hh_cond_exp_traub',
 u'hh_psc_alpha',
 u'ht_neuron',
 u'iaf_chs_2007',
 u'iaf_chxk_2008',
 u'iaf_cond_alpha',
 u'iaf_cond_alpha_mc',
 u'iaf_cond_exp',
 u'iaf_cond_exp_sfa_rr',
 u'iaf_neuron',
 u'iaf_psc_alpha',
 u'iaf_psc_alpha_canon',
 u'iaf_psc_alpha_multisynapse',
 u'iaf_psc_alpha_presc',
 u'iaf_psc_delta',
 u'iaf_psc_delta_canon',
 u'iaf_psc_exp',
 u'iaf_psc_exp_multisynapse',
 u'iaf_psc_exp_ps',
 u'iaf_tum_2000',
 u'izhikevich',
 u'mat2_psc_exp',
 u'mcculloch_pitts_neuron',
 u'mip_generator',
 u'multimeter',
 u'noise_generator',
 u'parrot_neuron',
 u'parrot_neuron_ps',
 u'poisson_generator',
 u'poisson_generator_ps',
 u'pp_pop_psc_delta',
 u'pp_psc_delta',
 u'ppd_sup_generator',
 u'pulsepacket_generator',
 u'sinusoidal_gamma_generator',
 u'sinusoidal_poisson_generator',
 u'sli_neuron',
 u'spike_detector',
 u'spike_generator',
 u'spin_detector',
 u'step_current_generator',
 u'subnet',
 u'topology_layer_free',
 u'topology_layer_free_3d',
 u'topology_layer_grid',
 u'topology_layer_grid_3d',
 u'voltmeter',
 u'volume_transmitter')

To know more about a particular model, execute in a new ipython shell

nest.help('iaf_psc_delta')

We are going to use the iaf_psc_delta model neuron for this simulation.

We define the default parameters for this model and later we set the model defaults to these values (for this session).

Neuron parameters:

  1. Synaptic delay
  2. The refractory period
  3. Membrane time constant
  4. The firing threshold
  5. Resting potential
  6. Reset potential
  7. EPSP Amplitude
  8. Background rate
  9. Membrane capacitance

In [6]:
delay = 1.5
tau_ref = 2.0
tau_m = 20.0
V_th = 20.0
V_e = 0.0
V_reset = 10.0
J_e = 0.1
eta = 2.0
C_m = 1.0

Network parameters

Define Neuron-neuron connection probabilities (10%)


In [7]:
connection_probability = 0.1
C_e = connection_probability*pop_e
C_i = connection_probability*pop_i

Factor for IPSP/EPSP amplitudes


In [8]:
g = 5.0

IPSP Amplitude


In [9]:
J_i = -1*g*J_e

Firing rate of a neuron in the external population


In [10]:
nu_ext = eta*V_th/(J_e*C_e*tau_m)

Population rate of the whole external population


In [11]:
p_rate = 1000.0*nu_ext*C_e

Make the nest kernel print progress of the simulation


In [12]:
nest.SetKernelStatus({'print_time': True})

Set the default values for the iaf_psc_delta neuron model


In [13]:
nest.SetDefaults('iaf_psc_delta', {
                                   'C_m': C_m, 
                                   'tau_m': tau_m, 
                                   't_ref': tau_ref, 
                                   'E_L': 0.0, 
                                   'V_th': V_th, 
                                   'V_reset': V_reset
                                   })

Create neurons


In [14]:
nodes = nest.Create('iaf_psc_delta', total_population)
nodes_e = nodes[:int(pop_e)]
nodes_i = nodes[int(pop_e):]

Create inputs and activity detectors

Create Poisson noise


In [15]:
noise = nest.Create('poisson_generator', 1, {'rate': p_rate})

Create a spike detector for each of the neuronal populations, and label them. Each detector outputs spikes into files corresponding to the label names


In [16]:
spikes = nest.Create('spike_detector', 2, [{'label': 'ex'}, {'label': 'in'}])
spikes_e = spikes[:1]
spikes_i = spikes[1:]

Configure Synapse Models

Set up synapse models with the help of pre-existing model 'static_synapse_hom_w', name them 'excitatory' and 'inhibitory'.


In [17]:
nest.CopyModel('static_synapse_hom_w', 'excitatory', {'weight': J_e, 'delay': delay})

nest.CopyModel('static_synapse_hom_w', 'inhibitory', {'weight': J_i, 'delay': delay})

Connect the nodes


In [18]:
nest.Connect(nodes_e, nodes, {'rule': 'fixed_indegree', 'indegree': int(C_e)}, 'excitatory')

nest.Connect(nodes_i, nodes, {'rule': 'fixed_indegree', 'indegree': int(C_i)}, 'inhibitory')

nest.Connect(noise, nodes, syn_spec='excitatory')

Connect probing devices


In [19]:
nest.Connect(nodes_e[:50], spikes_e)
nest.Connect(nodes_i[:50], spikes_i)

Simulate the model


In [20]:
nest.Simulate(300)

Plot the results


In [21]:
nest.raster_plot.from_device(spikes_e, hist=True)
pylab.show()



In [21]: