Allow more efficient implementation of trace-based STDP rules#152
Allow more efficient implementation of trace-based STDP rules#152neworderofjamie merged 94 commits intomasterfrom
Conversation
…and postsynaptic functions so either one can be substituted seperately
…model variables are substituted in correct places
…iables and code strings for applying them * New DECLARE_WEIGHT_UPDATE_MODEL macro that defines PreVarValues and PostVarValues correctly
…synaptic variables so as to maintain API compatibility
…psePopulation and passed empty arrays from existing functions
… postsynaptic weight update variables
…ames into weight update code blocks and insert pre and post-spike code into appropriate neuron kernels
…names into weight update code blocks and insert pre and post-spike code into appropriate neuron kernels
…nd postsynaptic weight update variables
Codecov Report
@@ Coverage Diff @@
## master #152 +/- ##
=========================================
Coverage ? 83.43%
=========================================
Files ? 45
Lines ? 7057
Branches ? 0
=========================================
Hits ? 5888
Misses ? 1169
Partials ? 0
Continue to review full report at Codecov.
|
…e_pre_post_var # Conflicts: # lib/include/codeGenUtils.h # lib/include/modelSpec.h # lib/include/newModels.h # lib/include/standardSubstitutions.h # lib/include/synapseGroup.h # lib/src/generateCPU.cc # lib/src/generateKernels.cc # lib/src/generateRunner.cc # lib/src/modelSpec.cc # lib/src/standardSubstitutions.cc
… up generation of variable push, pull and host initialisation loops
…ynaptic traces should get copied from previous delay slot
# Conflicts: # lib/src/codeGenUtils.cc
This reverts commit 1444cb7.
…ost_var # Conflicts: # lib/include/neuronGroup.h
…team/genn into weight_update_pre_post_var
…ht_update_pre_post_var # Conflicts: # lib/include/initSparseConnectivitySnippet.h
…ht_update_pre_post_var
…ost_var # Conflicts: # lib/include/codeGenUtils.h # lib/include/standardSubstitutions.h # lib/src/codeGenUtils.cc # lib/src/generateKernels.cc # lib/src/standardSubstitutions.cc
…s from post learn
… calling ``initConnectivity`` or ``initVar`` with a parameter-less model i.e. ``initConnectivity<InitSparseConnectivitySnippet::OneToOne>({})`` can now be just ``initConnectivity<InitSparseConnectivitySnippet::OneToOne>({})``
|
@tnowotny this is finally ready and, aside from documentation updates etc is the last feature for the 3.2.0 release! Are you ok to merge? Previous concerns about delays are fixed and I've added new tests. |
|
I believe the design is right. The code for updating the spike traces needs to be in the neuron kernel. The only other solution would be a separate kernel which seems silly unless the code was very heavy computationally and would lead to a lot of divergence of spiking and silent neurons in the neuron kernel. |
|
I did not inspect the code in detail as often; but I think we should go ahead and merge - there are some very busy times ahead. |
In the process of investigation spike-based learning in SpineML and finding it lacking, I realised that GeNN is missing some useful functionality for spike-based learning too.
If you want to implement trace-based STDP rules you often want to be able to have state that's only stored and updated once per pre or postsynaptic neuron - typically low-pass-filtered spike trains. Apart from by hacking this into neuron models, GeNN had no method to support this - until now....
Basically this pull request adds pre and postsynaptic state variables to weight update models (in a backward-compatible manner). These are substituted into existing bits of weight update user code in the normal way, but additionally there are two new piece of weight update user code which get inserted into the appropriate neuron kernel when populations spike. The last aspect is the one thing I'm a little concerned about as it seems a little ugly - any thought @tnowotny?
For an example - the following weight update model implements Pfister and Gerstner's triplet rule:
Continuing the theme of recreating bits of my thesis using GeNN I implemented the Sjostromet al. (2001) pairing frequency experiment here which shows that the GeNN version behaves much like the Pfister and Gerstner paper suggests: