Page 1 of 1

How to update the weight vector of a NetCon per time step

Posted: Mon Jan 03, 2022 11:15 pm
by klein
Hi, all
Happy New year

My question is how to update the weight vectors of NetCons per time step in a synapse PointProcess model.

To study metaplasticity, I defined the second and third elements of a NetCon's weight vector as two learning rates. I want my synapse PointProcess model with metaplasticity mechanisms to update those learning rates per time step in a clock manner. Multiple NetCons will be attached to my synapse model.

But it seems neither the DERIVATIVE nor the BREAKPOINT block can access those weight vectors. At least the FOR_NETCONS failed. My question is, can I do that?. If I can, how to do it.

I currently update those weight vector elements in an event-driven manner in the NET_RECEIVE block, it works. But eventually, I may design some metaplasticity model for which it's hard to find analytical solutions. So I prefer to update those weight vector elements in a time step manner.

Another solution may be to define those learning rates as state variables in a synapse model, then update them with DERIVATIVE and BREAKPOINT blocks. But in this case, each synapse PointProcess can only have one NetCon attached to it. It will be a waste.

################## explaining my question in the .mod file

BREAKPOINT {
SOLVE states METHOD cnexp
: can I access a_plus, a_minus of all NetCon connected with the synapse here?
}

DERIVATIVE states {
: can I access a_plus, a_minus of all NetCon connected with the synapse here?
}

NET_RECEIVE (w, a_plus, a_minus, trace_1 , trace_2, t_stamp) {
: Now I update a_plus, a_minus in an event-driven manner with a time stamp. Whenever there's a pre or post spike, I will update a_plus, a_minus with analytical solutions and update the time stamp.

:FOR_NETCONS works well here!
}

Re: How to update the weight vector of a NetCon per time step

Posted: Tue Jan 04, 2022 10:47 am
by ted
If the equations that govern the dynamics of a_plus and a_minus don't have an analytical solution, would a lookup table be useful?

Re: How to update the weight vector of a NetCon per time step

Posted: Tue Jan 04, 2022 2:19 pm
by klein
Thanks for your reply!

Yeah, that will be another option. But is it possible to update them in the DERIVATIVE BLOCK of the synapse mod file?

Thanks
Klein

Re: How to update the weight vector of a NetCon per time step

Posted: Thu Jan 06, 2022 2:58 pm
by ted
is it possible to update them in the DERIVATIVE BLOCK of the synapse mod file
Sure. Forget about using the NetCon's vector to store stream-specific variables other than weight[0]. Instead, make a mod file that declares as many a_plus and a_minus state variables as you need (one each for every NetCon that will drive the synaptic mechanism). In the DERIVATIVE block put an ODE for each of these state variables. This would not be as flexible as simply having a separate synaptic mechanism instance for each NetCon.

Re: How to update the weight vector of a NetCon per time step

Posted: Thu Jan 06, 2022 3:09 pm
by klein
Thank you very much, I will try that.