Learning Rules on Neuron Slices

#1

Hello, I am trying to use oja and bcm learning rules on connections between individual neurons in nengo simulations.

After getting some errors initially, I modified the following lines in learning_rules.build_bcm and learning_rules.build_oja

pre_activities = model.sig[get_pre_ens(conn).neurons]['out']
post_activities = model.sig[get_post_ens(conn).neurons]['out']

to

from nengo.builder.connection import slice_signal
in_signal = model.sig[conn]['in']
pre_activities = slice_signal(model, in_signal, conn.pre_slice)
out_signal = model.sig[conn]['out']
post_activities = slice_signal(model, out_signal, conn.post_slice)

There is likely a better way to implement this, but I wanted to raise this issue to the group in case others are experiencing this issue or if a fix to this could be incorporated into the next nengo update

0 Likes

#2

Hi. Welcome and thanks for the bug report and fix! We are tracking this issue here: https://github.com/nengo/nengo/issues/1526. I have added a comment documenting your suggestion. This will help us prioritize and resolve the issue. Thanks again.

0 Likes

#3

Great, thanks - I didn’t see that existing issue previously. The suggested fix there solved the problem better than the modifications I posted above.

0 Likes

#4

Oh that’s good to know! To clarify, what made the other fix better?

0 Likes

#5

The fix that I posted did not make the correct connections

0 Likes