[Stage M1] Chloé Pasturel : week 2

Simulation d'un ring model grâce au programme brian et observation des conséquences du changement de différents paramêtres

• simulation d'un ring par l'intermédiaire de brian http://briansimulator.org/
• courbe de sélectivité en fonction des parametres
• courbe de sélectivité à différents contrastes
In [1]:
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
fig_width_pt = 646.79  # Get this from LaTeX using \showthe\columnwidth
inches_per_pt = 1.0/72.27               # Convert pt to inches
fig_width = fig_width_pt*inches_per_pt  # width in inches

In [2]:
import brian as sim

/usr/local/lib/python2.7/site-packages/brian/utils/sparse_patch/__init__.py:39: UserWarning: Couldn't find matching sparse matrix patch for scipy version 0.13.3, but in most cases this shouldn't be a problem.
warnings.warn("Couldn't find matching sparse matrix patch for scipy version %s, but in most cases this shouldn't be a problem." % scipy.__version__)


Fonction ring :¶

In [3]:
def ring(N_theta=360, # nombre de neurones d'entrée = nombre neurones du ring
tau=10*sim.ms,
tau_e=2*sim.ms,
sigma_theta_ff=.5, # bandwidth de connections feed-forward
sigma_theta_lat=.5, # bandwidth de connections latérales
input_rate=30, # intensité de l'entrée
input_width=10, # largeur de l'entrée
weight_ff=1.25, # poids des connections feed-forward
weight_lat=.1, # poids des connections latérales
sparseness=.5,
t_run=2):

sim.clock.reinit_default_clock()
rates = sim.zeros(N_theta)*sim.Hz
rates[N_theta/2-input_width:N_theta/2+input_width] = sim.ones(2*input_width)*input_rate*sim.Hz

eqs='''
dv/dt=(I-v)/tau : volt
dI/dt=-I/tau_e : volt
'''
layer0 = sim.PoissonGroup(N_theta, rates=rates)
layerE = sim.NeuronGroup(N_theta, model=eqs, threshold=10*sim.mV, reset=0*sim.mV)

topomap = lambda i, j:np.exp((np.cos(2*np.pi*(i-j)/N_theta)-1.)/sigma_theta_ff**2)/sigma_theta_ff*weight_ff*sim.mV
feedforward = sim.Connection(layer0, layerE, sparseness=sparseness, weight=topomap)

lateralmap = lambda i, j:np.exp((np.cos(2*np.pi*(i-j)/N_theta)-1.)/sigma_theta_lat**2)/sigma_theta_lat*weight_lat*sim.mV
WEE = sim.Connection(layerE, layerE, sparseness=sparseness, weight=lateralmap)

nb_spikes = sim.SpikeCounter(layerE)
spikes = sim.SpikeMonitor(layerE)
sim.run(t_run * sim.second)
spikes_N = []
for i in range(N_theta) :
spikes_N.append(nb_spikes[i])

return spikes, feedforward, WEE, N_theta, spikes_N, rates

In [4]:
# on lance avec les parametres par défaut
spikes, feedforward, recurrent, N_theta, spikes_N, rates = ring()

fig, ax = sim.subplots(figsize=(fig_width, fig_width*9/16.))
sim.subplot(211)
sim.raster_plot(spikes, color='r', alpha=.3)
sim.yticks(np.linspace(0, 360, 5))
sim.plt.ylabel(u'numéro des neurones')
sim.plt.xlabel(u'temps (ms)')
sim.title('Raster')
sim.ylim([0, 360])
sim.subplot(234)
sim.imshow(feedforward.W.todense(), interpolation='nearest', origin='lower', cmap='Reds')
sim.xticks(np.linspace(0, 360, 5))
sim.yticks(np.linspace(0, 360, 5))
sim.title(u'Poids Feedforward')
sim.subplot(235)
sim.imshow(recurrent.W.todense(), interpolation='nearest', origin='lower', cmap='Reds')
sim.xticks(np.linspace(0, 360, 5))
sim.yticks(np.linspace(0, 360, 5))
sim.title(u'Poids récurrents')
sim.subplot(236)
theta = np.linspace(0, 2*np.pi, N_theta)
sim.plot(theta*180/np.pi, spikes_N, color='r', alpha=.7)
sim.xticks(np.linspace(0, 360, 5))
sim.yticks(np.linspace(0, 160, 5))
sim.plt.xlabel(r'$\theta$ ' u'(degrés)')
sim.plt.ylabel('nombre de spikes')
sim.title(u'Courbe de sélectivité')
sim.plt.tight_layout()
fig.savefig('figures/ring(week2).pdf')


Variation des paramètres :¶

sigma_theta_ff=.5 :¶

In [5]:
sigma_theta_ff = np.linspace(0.001, 1., 5)

for i, sigma_theta_ff_ in enumerate(sigma_theta_ff) :
spikes, feedforward, recurrent, N_theta, spikes_N, rates = ring(sigma_theta_ff=sigma_theta_ff_)
fig, ax = sim.subplots(figsize=(14, 6.5))
sim.subplot(211)
sim.raster_plot(spikes, color='r', alpha=.7)
sim.ylim([0, 360])
sim.subplot(234)
sim.imshow(feedforward.W.todense(), interpolation='nearest', origin='lower', cmap='Reds')
sim.title('Feedforward connection strengths')
sim.subplot(235)
sim.imshow(recurrent.W.todense(), interpolation='nearest', origin='lower', cmap='Reds')
sim.title('Recurrent connection strengths')
sim.subplot(236)
theta = np.linspace(0, 2*np.pi, N_theta)
sim.plot(theta, spikes_N, color='r', alpha=.7)
sim.plt.xlabel('theta')
sim.plt.ylabel('nombre de spikes')
sim.title('selectivite')

• sigma_theta_ff = 0.001 :
• connection feedforward pratiquement inexistante, pas de changement dans les connections reccurent
• pas de décharge neuronal

Quand sigma_theta_ff augmente :

* connection feedforward augmente
* la décharge neuronale augmente, puis diminue dépasser une certaine valeur
* Modifie la courbe de sélectivité


sigma_theta_lat=.5 :¶

In [6]:
sigma_theta_lat = np.linspace(0.001, 1., 5)

for i, sigma_theta_lat_ in enumerate(sigma_theta_lat):
spikes, feedforward, recurrent, N_theta, spikes_N, rates = ring(sigma_theta_lat=sigma_theta_lat_)
fig, ax = sim.subplots(figsize=(14, 6.5))
sim.subplot(211)
sim.raster_plot(spikes, color='r', alpha=.7)
sim.ylim([0, 360])
sim.subplot(234)
sim.imshow(feedforward.W.todense(), interpolation='nearest', origin='lower', cmap='Reds')
sim.title('Feedforward connection strengths')
sim.subplot(235)
sim.imshow(recurrent.W.todense(), interpolation='nearest', origin='lower', cmap='Reds')
sim.title('Recurrent connection strengths')
sim.subplot(236)
theta = np.linspace(0, 2*np.pi, N_theta)
sim.plot(theta, spikes_N, color='r', alpha=.7)
sim.plt.xlabel('theta')
sim.plt.ylabel('nombre de spikes')
sim.title('selectivite')