Skip to content

Commit

Permalink
fix bugs on NMDA synapses
Browse files Browse the repository at this point in the history
  • Loading branch information
chaoming0625 committed Apr 22, 2022
1 parent 1c2df42 commit fe95783
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions brainpy/dyn/synapses/abstract_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1227,8 +1227,9 @@ def update(self, _t, _dt):
post_g = bm.sum(self.g)
if not self.conn.include_self:
post_g = post_g - self.g
post_g = post_g * self.g_max
else:
post_g = self.g * self.g_max
post_g = self.g @ self.g_max
elif isinstance(self.conn, One2One):
post_g = self.g_max * self.g
else:
Expand All @@ -1242,4 +1243,4 @@ def update(self, _t, _dt):

# output
g_inf = 1 + self.cc_Mg / self.beta * bm.exp(-self.alpha * self.post.V)
self.post.input -= post_g * (self.post.V - self.E) / g_inf
self.post.input += post_g * (self.E - self.post.V) / g_inf

0 comments on commit fe95783

Please sign in to comment.