Exemplo n.º 1
0
    def event_generators(self, gid):
        """two stimuli: one that makes the cell spike, the other to monitor STDP
        """

        stimulus_times = numpy.linspace(50, 500, self.n_pairs)

        # strong enough stimulus
        spike = arbor.event_generator("synapse", 1., arbor.explicit_schedule(stimulus_times))

        # zero weight -> just modify synaptic weight via stdp
        stdp = arbor.event_generator("stpd_synapse", 0., arbor.explicit_schedule(stimulus_times - self.dT))

        return [spike, stdp]
Exemplo n.º 2
0
 def test_event_generator_explicit_schedule(self):
     cm = arb.cell_member(0, 42)
     es = arb.explicit_schedule([0, 1, 2, 3, 4.4])
     eg = arb.event_generator(cm, -0.01, es)
     self.assertEqual(eg.target.gid, 0)
     self.assertEqual(eg.target.index, 42)
     self.assertAlmostEqual(eg.weight, -0.01)
Exemplo n.º 3
0
 def test_event_generator_poisson_schedule(self):
     cm = arb.cell_member(4, 2)
     ps = arb.poisson_schedule(0., 10., 0)
     pg = arb.event_generator(cm, 42., ps)
     self.assertEqual(pg.target.gid, 4)
     self.assertEqual(pg.target.index, 2)
     self.assertEqual(pg.weight, 42.)
Exemplo n.º 4
0
 def test_event_generator_regular_schedule(self):
     cm = arb.cell_local_label("tgt0")
     rs = arb.regular_schedule(2.0, 1., 100.)
     rg = arb.event_generator(cm, 3.14, rs)
     self.assertEqual(rg.target.label, "tgt0")
     self.assertEqual(rg.target.policy, arb.selection_policy.univalent)
     self.assertAlmostEqual(rg.weight, 3.14)
Exemplo n.º 5
0
 def test_event_generator_regular_schedule(self):
     cm = arb.cell_member(42, 3)
     rs = arb.regular_schedule(2.0, 1., 100.)
     rg = arb.event_generator(cm, 3.14, rs)
     self.assertEqual(rg.target.gid, 42)
     self.assertEqual(rg.target.index, 3)
     self.assertAlmostEqual(rg.weight, 3.14)
Exemplo n.º 6
0
 def test_event_generator_explicit_schedule(self):
     cm = arb.cell_local_label("tgt1", arb.selection_policy.round_robin)
     es = arb.explicit_schedule([0,1,2,3,4.4])
     eg = arb.event_generator(cm, -0.01, es)
     self.assertEqual(eg.target.label, "tgt1")
     self.assertEqual(eg.target.policy, arb.selection_policy.round_robin)
     self.assertAlmostEqual(eg.weight, -0.01)
Exemplo n.º 7
0
 def event_generators(self, gid):
     sched_dt = 0.25
     weight = 400
     return [
         A.event_generator((gid, 0), weight, A.regular_schedule(sched_dt))
         for gid in range(0, self.num_cells())
     ]
Exemplo n.º 8
0
 def event_generators(self, gid):
     if gid==0:
         sched = arbor.explicit_schedule([1]) # one event at 1 ms
         weight = 0.1 # 0.1 μS on expsyn
         return [arbor.event_generator('syn', weight, sched)]
     return []
Exemplo n.º 9
0
 def test_event_generator_poisson_schedule(self):
     ps = arb.poisson_schedule(0., 10., 0)
     pg = arb.event_generator("tgt2", 42., ps)
     self.assertEqual(pg.target.label, "tgt2")
     self.assertEqual(pg.target.policy, arb.selection_policy.univalent)
     self.assertEqual(pg.weight, 42.)
Exemplo n.º 10
0
 def test_event_generator_regular_schedule(self):
     rs = arb.regular_schedule(2.0, 1., 100.)
     rg = arb.event_generator(3, 3.14, rs)
     self.assertEqual(rg.target, 3)
     self.assertAlmostEqual(rg.weight, 3.14)
Exemplo n.º 11
0
 def event_generators(self, gid):
     print_v('Getting event_generators for: %s'%(gid))
     if gid==0:
         sched = arbor.explicit_schedule([1])
         return [arbor.event_generator((0,0), 0.1, sched)]
     return []
Exemplo n.º 12
0
 def event_generators(self, gid):
     if gid==0:
         sched = arbor.explicit_schedule([1])
         weight = 0.1
         return [arbor.event_generator('syn', weight, sched)]
     return []
Exemplo n.º 13
0
 def test_event_generator_poisson_schedule(self):
     ps = arb.poisson_schedule(0., 10., 0)
     pg = arb.event_generator(2, 42., ps)
     self.assertEqual(pg.target, 2)
     self.assertEqual(pg.weight, 42.)
Exemplo n.º 14
0
 def test_event_generator_explicit_schedule(self):
     es = arb.explicit_schedule([0,1,2,3,4.4])
     eg = arb.event_generator(42, -0.01, es)
     self.assertEqual(eg.target, 42)
     self.assertAlmostEqual(eg.weight, -0.01)
Exemplo n.º 15
0
 def event_generators(self, gid):
     t0 = 0
     idx = 0
     sched = arbor.poisson_schedule(t0, self.lambda_, gid + self.seed_)
     return [arbor.event_generator(idx, self.weight_ext_, sched)]
Exemplo n.º 16
0
 def event_generators(self, gid):
     if gid==0:
         sched = arbor.explicit_schedule([1])
         return [arbor.event_generator(arbor.cell_member(0,0), 0.1, sched)]
     return []
Exemplo n.º 17
0
 def connections_on(self, gid):
     src = (gid - 1) % self.ncells
     w = 0.01
     d = 5
     weight = 0.1
     return [arbor.event_generator(arbor.cell_member(0, 0), weight, sched)]