(Brunel & Hakim, 1999) Fast Global Oscillation

Implementation of the paper:

  • Brunel, Nicolas, and Vincent Hakim. “Fast global oscillations in networks of integrate-and-fire neurons with low firing rates.” Neural computation 11.7 (1999): 1621-1671.

Author: Chaoming Wang

[1]:
import brainpy as bp
import brainpy.math as bm

bm.set_platform('cpu')
[2]:
Vr = 10.  # mV
theta = 20.  # mV
tau = 20.  # ms
delta = 2.  # ms
taurefr = 2.  # ms
duration = 100.  # ms
J = .1  # mV
muext = 25.  # mV
sigmaext = 1.  # mV
C = 1000
N = 5000
sparseness = float(C) / N
[3]:
class LIF(bp.dyn.NeuGroup):
  def __init__(self, size, **kwargs):
    super(LIF, self).__init__(size, **kwargs)

    # variables
    self.V = bm.Variable(bm.ones(self.num) * Vr)
    self.t_last_spike = bm.Variable(-1e7 * bm.ones(self.num))
    self.spike = bm.Variable(bm.zeros(self.num, dtype=bool))
    self.refractory = bm.Variable(bm.zeros(self.num, dtype=bool))

    # integration functions
    fv = lambda V, t: (-V + muext) / tau
    gv = lambda V, t: sigmaext / bm.sqrt(tau)
    self.int_v = bp.sdeint(f=fv, g=gv)

  def update(self, tdi):
    V = self.int_v(self.V, tdi.t, tdi.dt)
    in_ref = (tdi.t - self.t_last_spike) < taurefr
    V = bm.where(in_ref, self.V, V)
    spike = V >= theta
    self.spike.value = spike
    self.V.value = bm.where(spike, Vr, V)
    self.t_last_spike.value = bm.where(spike, tdi.t, self.t_last_spike)
    self.refractory.value = bm.logical_or(in_ref, spike)
[4]:
group = LIF(N)
syn = bp.synapses.Delta(group, group,
                        conn=bp.conn.FixedProb(sparseness),
                        delay_step=int(delta / bm.get_dt()),
                        post_ref_key='refractory',
                        output=bp.synouts.CUBA(target_var='V'),
                        g_max=-J)
net = bp.dyn.Network(syn, group=group)
[5]:
runner = bp.dyn.DSRunner(net, monitors=['group.spike'])
runner.run(duration)
bp.visualize.raster_plot(runner.mon.ts, runner.mon['group.spike'],
                         xlim=(0, duration), show=True)
../_images/oscillation_synchronization_Brunel_Hakim_1999_fast_oscillation_6_1.png