Example #1
0
 def update(self, _t, _dt):
     self.pre_spike.push(self.pre.spike)
     delayed_spike = self.pre_spike.pull()
     post_sp = bm.pre2post_event_sum(delayed_spike, self.pre2post,
                                     self.post.num, self.g_max)
     self.g.value = self.integral(self.g.value, _t, dt=_dt) + post_sp
     self.post.input += self.g * (self.E - self.post.V)
Example #2
0
 def update(self, _t, _dt):
   self.pre_spike.push(self.pre.spike)
   delayed_pre_spike = self.pre_spike.pull()
   post_vs = bm.pre2post_event_sum(delayed_pre_spike, self.pre2post, self.post.num, self.w)
   target = getattr(self.post, self.post_key)
   if self.post_has_ref:
     target += post_vs * (1. - self.post.refractory)
   else:
     target += post_vs
 def update(self, _t, _dt):
     self.pre_sps.push(self.pre.spike)
     delayed_sps = self.pre_sps.pull()
     if self.conn_type in [0, 1]:
         post_vs = bm.pre2post_event_sum(delayed_sps, self.pre2post,
                                         self.post.num, self.weights)
     elif self.conn_type == 2:
         post_vs = bm.pre2post_event_sum2(delayed_sps, self.pre_ids,
                                          self.post_ids, self.post.num,
                                          self.weights)
         # post_vs = bm.zeros(self.post.num)
         # post_vs = post_vs.value.at[self.post_ids.value].add(delayed_sps[self.pre_ids.value])
     elif self.conn_type == 3:
         post_vs = bm.pre2post_event_sum3(delayed_sps, self.pre2post,
                                          self.post.num, self.weights,
                                          self.max_post_conn)
     elif self.conn_type == 4:
         post_vs = bm.pre2post_event_sum4(delayed_sps, self.pre2post,
                                          self.post.num, self.weights,
                                          self.max_post_conn)
     else:
         raise ValueError
     self.post.I += post_vs
 def true_fn(x):
     post_vs = bm.pre2post_event_sum(self.pre.spike, self.pre2post,
                                     self.post.num, self.weights)
     self.post.I += post_vs
Example #5
0
 def update(self, _t, _dt):
     self.g.value = self.integral(self.g, _t, dt=_dt)
     post_sps = bm.pre2post_event_sum(self.pre.spike, self.pre2post,
                                      self.post.num, self.g_max)
     self.g.value += post_sps
     self.post.input += self.g * (self.E - self.post.V)