brian2genn icon indicating copy to clipboard operation
brian2genn copied to clipboard

heterogeneous delays

Open wxie2013 opened this issue 4 years ago • 8 comments

The recent versions of GeNN support heterogeneous delays. Is it possible to implement the heterogeneous delays in the interface? Thanks

wxie2013 avatar May 05 '20 19:05 wxie2013

@tnowotny, @neworderofjamie: it seems that GeNN supports heterogeneous delays since version 3.2, but after a quick look at the documentation, I did not immediately see how to specify them. If it is straightforward, it would be great to support the feature in Brian2GeNN.

mstimberg avatar May 06 '20 13:05 mstimberg

So, on the GeNN side you use heterogeneous delays by modifying your weight update model e.g.

class StaticPulseDendriticDelay : public Base
{
public:
    DECLARE_WEIGHT_UPDATE_MODEL(StaticPulseDendriticDelay, 0, 2, 0, 0);

    SET_VARS({{"g", "scalar", VarAccess::READ_ONLY}, {"d", "uint8_t", VarAccess::READ_ONLY}});

    SET_SIM_CODE("$(addToInSynDelay, $(g), $(d));\n");
};

However, they are dendritic delays unlike the standard delays in GeNN which are axonal. This is irrelevant if they are used on static connections but, they don't necessarily play well with STDP as back-propogating postsynaptic spikes can't be delayed heterogeneosuly to match (if that makes sense)

neworderofjamie avatar May 06 '20 13:05 neworderofjamie

Thanks for the info @neworderofjamie . I'll have to think about this a bit more. Delays in Brian are always axonal at the moment, so there's no way to express the difference (i.e. to raise an error if the user provides axonal delays and ask them to specify dendritic delays instead). But just by checking what kind of variables are used in the statements we should be able to allow it whenever it does not matter.

mstimberg avatar May 11 '20 13:05 mstimberg

This issue could be looked at in GSoC 2021 I think.

tnowotny avatar Apr 01 '21 10:04 tnowotny

So, on the GeNN side you use heterogeneous delays by modifying your weight update model e.g.

class StaticPulseDendriticDelay : public Base
{
public:
    DECLARE_WEIGHT_UPDATE_MODEL(StaticPulseDendriticDelay, 0, 2, 0, 0);

    SET_VARS({{"g", "scalar", VarAccess::READ_ONLY}, {"d", "uint8_t", VarAccess::READ_ONLY}});

    SET_SIM_CODE("$(addToInSynDelay, $(g), $(d));\n");
};

However, they are dendritic delays unlike the standard delays in GeNN which are axonal. This is irrelevant if they are used on static connections but, they don't necessarily play well with STDP as back-propogating postsynaptic spikes can't be delayed heterogeneosuly to match (if that makes sense)

Does it mean the standard delays in GeNN are axonal, but for heterogeneous delays, one has to use dendritic delay?

wxie2013 avatar May 13 '22 15:05 wxie2013

yes, exactly. The axonal ones are homogeneous and defined in the add_synapse_population command, the dendritic ones as described by Jamie above.

tnowotny avatar May 13 '22 18:05 tnowotny

Thanks. It is correct that to implement heterogeneous delays in brian2genn, one need to update GeNN to have this function first? If this is correct, would you please provide some hints which part of the code in GeNN to start to work on this update in GeNN?

wxie2013 avatar May 13 '22 19:05 wxie2013

As an initial step, you could implement heterogeneous delays on static synapses without making any changes to GeNN by extending Brian2GeNN to genetate the code I pasted earlier (which I think would already be a big step forward).

neworderofjamie avatar May 14 '22 08:05 neworderofjamie