Skip to content

Commit fe95783

Browse files
committed
fix bugs on NMDA synapses
1 parent 1c2df42 commit fe95783

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

brainpy/dyn/synapses/abstract_models.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1227,8 +1227,9 @@ def update(self, _t, _dt):
12271227
post_g = bm.sum(self.g)
12281228
if not self.conn.include_self:
12291229
post_g = post_g - self.g
1230+
post_g = post_g * self.g_max
12301231
else:
1231-
post_g = self.g * self.g_max
1232+
post_g = self.g @ self.g_max
12321233
elif isinstance(self.conn, One2One):
12331234
post_g = self.g_max * self.g
12341235
else:
@@ -1242,4 +1243,4 @@ def update(self, _t, _dt):
12421243

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

0 commit comments

Comments
 (0)