-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Time-driven pre and postsynaptic traces #377
Conversation
…ateModel::Base::getPostDynamicsCode`` virtuals
…NeuronGroup::getInSynWithPostCode`` and ``NeuronGroup::getOutSynWithPreCode``
…o be manually copied between delay slots in the absence of a spike
…ariable in threshold conditions
# Conflicts: # src/genn/genn/code_generator/groupMerged.cc
… structure for tracking merged postsynaptic models can be much simplified
Codecov Report
@@ Coverage Diff @@
## master #377 +/- ##
==========================================
+ Coverage 86.46% 86.65% +0.18%
==========================================
Files 70 70
Lines 12331 12407 +76
==========================================
+ Hits 10662 10751 +89
+ Misses 1669 1656 -13
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for being late with this observation but how is the code set by SET_PRE_SPIKE_CODE treated any differently from that set with SET_SIM_CODE.
Similarly, how is the code from SET_POST_SPIKE_CODE different from the code set in SET_POST_LEARN ?
For the new time-driven code snippets, I don't quite see how either of them (PRE or POST) are to be treated differently from the code set generally through SET_SYNAPSE_DYNAMICS_CODE. What am I missing? Or do you feel it benefits the user to have these options to further mark up the roles of each code snippet?
The main difference is that |
oh - I see ... so access to variables should be constrained to pre or post-synaptic variables for pre or post-synaptic code ...? |
exactly - you can access parameters, pre/postsynaptic weight update model variables and pre/postsynaptic neuron variables as appropriate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah ... makes sense now. One typo in a comment.
#152 added support for pre and postsynaptic weight update model variables to allow better encapsulation of learning vs neuron dynamics. However, these were purely event-driven dynamics which, retrospectively:
In this P.R. we introduce new syntax for time-driven pre and postsynaptic traces:
Python
For example, the following simple additive STDP rule:
can now be implemented more efficiently as:
C++
In C++, the following macros have the same effect:
Syntactically, this works nicely but, the resultant generated code is a bit of a mess with lots of duplication of pre and postsynaptic traces and code in a neuron update kernel. A similar approach to #201 is required for traces, but I think that's one to fix in a future PR.