brainpy/BrainPy

Inconsistent "include_self" flag in "brainpy._src.dynold.synapses._TwoEndConnAlignPre" and "brainpy._src.dnn.linear.AllToAll"

CloudyDory opened this issue · 1 comments

  • Check for duplicate issues.
  • Provide a complete example of how to reproduce the bug, wrapped in triple backticks like this:

When passing brainpy.conn.All2All(include_self=False) into brainpy.synapses.AMPA class, the include_self=False flag seems to be silently ignored.

Running the following code:

import brainpy as bp

E = bp.neurons.HH(size=4)
Synapse = bp.synapses.AMPA(E, E, bp.conn.All2All(include_self=False))

print(Synapse.conn.include_self)
print(Synapse.comm.include_self)

outputs:

False
True

And it seems that when computing the synaptic current, setting include_self to True or False makes no difference.

Thank you for your report. This is a bug.

The error is caused by the following line, which does not initialize a correct AllToAll connection.

self.comm = linear.AllToAll(pre.num, post.num, g_max)