-
Notifications
You must be signed in to change notification settings - Fork 45
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
Meanfield model #1136
base: meanfield_model
Are you sure you want to change the base?
Meanfield model #1136
Conversation
…correct_spikearray_waring fixed the check for early spikes
…extract_iobuf_during_run remove extract_iobuf_during_run flag
There's apparently also a crash, but I can't reproduce that locally
…doc-fix Documentation fix
…send_sync_repeat allow for mutliple send_sync
…doc-fix Trying to fix a crash...
add the reel error function
change real error function for an erzate
write some comments
Do an approxiamtion of 2 over sqrt(pi) in order to remove the error due to the sqrtk() function. Start to remove division in the threshold_func().
modified: meanfield/models/meanfield_model_impl.h Set threshold_func() add and remove r_squared() because don't implemented yet. No removing of division yet.
modified: ../../spynnaker/pyNN/models/neuron/builds/meanfield_base.py modified: ../../spynnaker/pyNN/models/neuron/implementations/meanfield_impl_standard.py modified: ../../spynnaker/pyNN/models/neuron/neuron_models/config.py modified: ../../spynnaker/pyNN/models/neuron/neuron_models/meanfield_model_eitn.py ADD Vi and put it like state_variables CHANGE muV from state_variables to parameters
modified: ../../spynnaker/pyNN/models/neuron/builds/meanfield_base.py modified: ../../spynnaker/pyNN/models/neuron/implementations/meanfield_impl_standard.py modified: ../../spynnaker/pyNN/models/neuron/neuron_models/config.py pbl when add Vi obtain DIBBY0 error but now clue where.
modified: meanfield/models/meanfield_model_impl.c modified: meanfield/models/meanfield_model_impl.h modified: ../../spynnaker/pyNN/models/neuron/builds/meanfield_base.py modified: ../../spynnaker/pyNN/models/neuron/implementations/meanfield_impl_standard.py modified: ../../spynnaker/pyNN/models/neuron/neuron_models/meanfield_model_eitn.py try to solved the error DIVBY0 and pass from 10 vars recorded to 5.
modified: ../../src/meanfield/models/meanfield_model_impl.c modified: ../../../spynnaker/pyNN/models/neuron/implementations/meanfield_impl_standard.py modified: ../../../spynnaker/pyNN/models/neuron/neuron_models/meanfield_model_eitn.py modified: ../../../spynnaker8/extra_models/__init__.py OK problem don't comming from printing data but I guess from creating them. I will change some C code in meanfield_impl_standard.h PBL is like if Ve and g_syn are ok to be create but not Vi and Fout_th for a 5 vars recorded
Need to add Vi really to tyhe implementation and so to meanfield_model_impl.h and .c and to meanfield_model.h so if need comme back here
modified: ../../src/meanfield/models/meanfield_model.h modified: ../../src/meanfield/models/meanfield_model_impl.c Ok that working a priori, it's not the most beautiful but it's working Just one comment is : the numbers between Ve and Vi are not treat as the same, don't understadn why??
modified: src/meanfield/models/meanfield_model.h modified: src/meanfield/models/meanfield_model_impl.c a priori that's work for Ve, Vi and Fout_th ->will add an other TF() and so an other threshold_function() in order to have a MF
before add config Vi
modified: config.h modified: meanfield_model.h modified: meanfield_model_impl.c Add in the c code the inhibitory contribution of the MF and so the differenciation btw Exc and Inh. Names of some variables and params will be change in order to don't induce misunderstanding.
modified: Makefile modified: ../../../src/meanfield/implementations/meanfield_impl_standard.h renamed: ../../../src/meanfield/models/Vthre_params.h -> ../../../src/meanfield/models/P_fit_polynomial.h modified: ../../../src/meanfield/models/meanfield_model.h modified: ../../../src/meanfield/models/meanfield_model_impl.c modified: ../../../../spynnaker/pyNN/models/neuron/abstract_pynn_meanfield_model_standard.py modified: ../../../../spynnaker/pyNN/models/neuron/builds/meanfield_base.py Add the other transfert function for inhibitors in C code, -> take parameters from config.h to an other Opaque structure P_fit_polynomial.h that's compile
modified: Makefile modified: ../../../src/meanfield/implementations/meanfield_impl_standard.h modified: ../../../src/meanfield/models/meanfield_model.h modified: ../../../src/meanfield/models/meanfield_model_impl.c renamed: ../../../src/meanfield/models/config.h -> ../../../src/meanfield/models/params_from_network.h renames config.h to params_from_network.h in order to be more precise in the correspondance btw code and litterature. change names of types, arrays and structure. compilation is ok
modified: ../../../src/meanfield/models/params_from_network.h was changeing mathsbox.h for estimate_err_func.h but go back bcs I don't know if I will implement other function inside mathsbox and not just error function
wasn't go back totaly
modified: builds/meanfield_base.py modified: implementations/meanfield_impl_standard.py renamed: neuron_models/config.py -> neuron_models/params_from_network.py change name config.py for params_from_network.py and so in files
modified: builds/meanfield_base.py new file: neuron_models/p_fit_polynomial.py modified: neuron_models/params_from_network.py add an other struct file to implemente params from fit of single neuron for Vthre polynome
…dard.h modified: ../../../src/meanfield/models/params_from_network.h modified: ../../../../spynnaker/pyNN/models/neuron/builds/meanfield_base.py modified: ../../../../spynnaker/pyNN/models/neuron/implementations/meanfield_impl_standard.py modified: ../../../../spynnaker/pyNN/models/neuron/neuron_models/__init__.py modified: ../../../../spynnaker/pyNN/models/neuron/neuron_models/p_fit_polynomial.py modified: ../../../../spynnaker/pyNN/models/neuron/neuron_models/params_from_network.py A priori meanfield_model_cond.dict says that I'm out of DTCM. That's why I get the error: "Population meanfield_model_cond does not have parameter p0" Go back to the past commit without inh implemented, just to see.
…base.py modified: ../../../../spynnaker/pyNN/models/neuron/implementations/meanfield_impl_standard.py renamed: ../../../../spynnaker/pyNN/models/neuron/neuron_models/p_fit_polynomial.py -> ../../../../spynnaker/pyNN/models/neuron/neuron_models/P_fit_polynomial_exc.py new file: ../../../../spynnaker/pyNN/models/neuron/neuron_models/P_fit_polynomial_inh.py modified: ../../../../spynnaker/pyNN/models/neuron/neuron_models/__init__.py CHECK POINT That's compile and work in virtual mode for c and python. ERROR : DIVBY0 when reel mode
modified: ../../../../spynnaker/pyNN/models/neuron/builds/meanfield_base.py DIVBY0 error is solved, due to put state var in local but don't go back to struct so all the time 0. RESUME : - TF for exc and inh with - some name changed in the files and in variables WILL: - Change MeanfieldModelEitn in python - add adaptation W ODE - change Fout_th for W in output
modified: __init__.py renamed: meanfield_model_eitn.py -> meanfield_of_adex_network.py Change the name from meanfield_model_eitn.py to meanfield_of_adex_network.py
…dard.h modified: ../../../src/meanfield/models/meanfield_model_impl.c modified: ../../../src/meanfield/models/meanfield_model_impl.h modified: ../../../../spynnaker/pyNN/models/neuron/builds/meanfield_base.py modified: ../../../../spynnaker/pyNN/models/neuron/implementations/meanfield_impl_standard.py modified: ../../../../spynnaker/pyNN/models/neuron/neuron_models/meanfield_of_adex_network.py Add the structure for adaptation W, that's work but give non-sense results. Need to add a start value and the real ODE.
modified: ../../../../spynnaker/pyNN/models/neuron/builds/meanfield_base.py modified: ../../../../spynnaker/pyNN/models/neuron/neuron_models/meanfield_of_adex_network.py Correct some error but have an error when calculating EDO with RK2_midpoint. maybe "error" come from recorder.py and constant.py will do some test so if need come back here
modified: ../../../src/meanfield/models/meanfield_model_impl.h modified: ../../../../spynnaker/pyNN/models/neuron/builds/meanfield_base.py modified: ../../../../spynnaker/pyNN/models/neuron/implementations/meanfield_impl_standard.py modified: ../../../../spynnaker/pyNN/models/neuron/neuron_models/meanfield_of_adex_network.py modified: ../../../../spynnaker/pyNN/models/recorder.py modified: ../../../../spynnaker/pyNN/utilities/constants.py do some modification aparently without effect of recorder and constant in rder to integrate Ve, Vi and W. Will modify meanfield_t because Vthre left in it but not anymore in meanfield_t and so modif meanfield_f_adex_network.py
modified: ../../../../spynnaker/pyNN/models/neuron/builds/meanfield_base.py modified: ../../../../spynnaker/pyNN/models/neuron/neuron_models/meanfield_of_adex_network.py remove nbr from meanfielf_t and to meanfield_of_adex_network.py
modified: ../../../../spynnaker/pyNN/models/neuron/builds/meanfield_base.py modified: ../../../../spynnaker/pyNN/models/neuron/neuron_models/meanfield_of_adex_network.py No clue of why w return uint32 DataType and not S1615. Will try in switching Vi and w
…dard.h modified: ../../../src/meanfield/models/meanfield_model.h modified: ../../../src/meanfield/models/meanfield_model_impl.c modified: ../../../../spynnaker/pyNN/models/neuron/neuron_models/meanfield_of_adex_network.py SAVE POINT now that's fonctionnaly work. NEED to optimise or doing real ode solver and error_function
modified: ../../../src/meanfield/models/meanfield_model_impl.c modified error_function with midpoint methode for integration. will do pregressively trapezoidale and Simpson if possible in ITCM BUT try to have an homogeneous patern i.e. EULER and Midpoint integrale for error function.
modified: ../../../../spynnaker/pyNN/models/neuron/builds/meanfield_base.py Did some cleanning, correction and rewriting of euler, RK2, mu_Ge and modif TvN= Tv only because of the original paper. Need to ask for that!! Modif T_inv in value. need to find a way to plot but plt.show don't work on the terminal.
modified: ../../../src/meanfield/models/meanfield_model_impl.c modified: ../../../../spynnaker/pyNN/models/neuron/builds/meanfield_base.py Do some clarification and try some method to remove the 'overflowed ITCM' message because of sqrtk sqrt function is not activated, so sV is on the square value. Need to find a solution for sqrt without overflowed ITCM
too much changes, so will have too much conflict to fixe so merge with -s ours
…ld_model into meanfield_model try to merge origin_MF with this local branch with -s ours option in order to remove conflict
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.
This looks in general fine to me; there are a few considerations you can make (see comments) as to where you can avoid some divides. I don't think these will help hugely with making enough space to use sqrtk() - we may have to think of another way around that. But I would be happy to merge this once you've addressed the comments and we can discuss what might be possible for sqrtk() after that.
//return config->Vthre; | ||
|
||
Vthre = P0\ | ||
+ P1*(muV-muV0)/DmuV0\ |
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.
DmuV0, DsV0 and DTvN0 are all parameters that come directly from constant values in python - you can avoid the divides here in this function by instead sending in 1/DmuV0 etc. and multiplying.
Tv += ACS_DBL_TINY; | ||
} | ||
|
||
pNetwork->TvN = Tv*Gl/Cm; // Thomas : Heu, useless no?? |resp-> TvN is a dimensional so usefull var |
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.
Worth considering 1/Cm here too.
|
||
params->muV = (muGe*params->Ee+muGi*params->Ei+params->Gl*params->El); //fake one | ||
pNetwork->muGn = muG/Gl; |
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.
Here Gl is a constant, so again sending in 1/Gl and multiplying may help. (In this instance I think you probably need to send both Gl and 1/Gl).
Hi Andrew,
yes I noticed before sending to the remote that I could do these
modifications, that I did on another branch on my local repo.
The problem is that it overflowed more with multiplication than with
division.
I think that the main reason is because the multiplication selected for
that is a too big memory needed.
So my question is, could I select one particular multiplication without
writing the name of the function and passing to " / "
symbol?
On the division side I wonder also if I could use divergente series in
order to approximate the result efficiently?
Same idea for the square root but I didn't know any divergente series for
the square root, yet!! ^^
I was fight with this issue so sending this intermediate code was a step in
order to know the procedure.
But now that I know it, I will send it to you when the job is done.
Sincerely
Thomas
Le lun. 29 nov. 2021 à 10:04, Andrew Gait ***@***.***> a
écrit :
… ***@***.**** requested changes on this pull request.
This looks in general fine to me; there are a few considerations you can
make (see comments) as to where you can avoid some divides. I don't think
these will help hugely with making enough space to use sqrtk() - we may
have to think of another way around that. But I would be happy to merge
this once you've addressed the comments and we can discuss what might be
possible for sqrtk() after that.
------------------------------
In neural_modelling/src/meanfield/models/meanfield_model_impl.c
<#1136 (comment)>
:
> - + config->P2*(config->sV-config->sV0)/config->DsV0\
- + config->P3*(config->TvN-config->TvN0)/config->DTvN0\
- + config->P5*((config->muV-config->muV0)/config->DmuV0)*((config->muV-config->muV0)/config->DmuV0)\
- + config->P6*((config->sV-config->sV0)/config->DsV0)*((config->sV-config->sV0)/config->DsV0)\
- + config->P7*((config->TvN-config->TvN0)/config->DTvN0)*((config->TvN-config->TvN0)/config->DTvN0)\
- + config->P8*(config->muV-config->muV0)/config->DmuV0*(config->sV-config->sV0)/config->DsV0\
- + config->P9*(config->muV-config->muV0)/config->DmuV0*(config->TvN-config->TvN0)/config->DTvN0\
- + config->P10*(config->sV-config->sV0)/config->DsV0*(config->TvN-config->TvN0)/config->DTvN0;
- */
-
- config->Vthre = config->P0;
-
- //return config->Vthre;
+
+ Vthre = P0\
+ + P1*(muV-muV0)/DmuV0\
DmuV0, DsV0 and DTvN0 are all parameters that come directly from constant
values in python - you can avoid the divides here in this function by
instead sending in 1/DmuV0 etc. and multiplying.
------------------------------
In neural_modelling/src/meanfield/models/meanfield_model_impl.c
<#1136 (comment)>
:
> @@ -251,121 +236,153 @@ void get_fluct_regime_varsup(REAL Ve, REAL Vi, config_t *restrict params)
{
Fi += ACS_DBL_TINY;
}
+
+ REAL Tv = ( Fe*(Ue*Te)*(Ue*Te) + Fi*(Ti*Ui)*(Ti*Ui))\
+ /(Fe*(Ue*Te)*(Ue*Te)/(Te+Tm) + Fi*(Ti*Ui)*(Ti*Ui)/(Ti+Tm));
+
+ if (Tv < ACS_DBL_TINY){
+ Tv += ACS_DBL_TINY;
+ }
+
+ pNetwork->TvN = Tv*Gl/Cm; // Thomas : Heu, useless no?? |resp-> TvN is a dimensional so usefull var
Worth considering 1/Cm here too.
------------------------------
In neural_modelling/src/meanfield/models/meanfield_model_impl.c
<#1136 (comment)>
:
>
- params->muV = (muGe*params->Ee+muGi*params->Ei+params->Gl*params->El); //fake one
+ pNetwork->muGn = muG/Gl;
Here Gl is a constant, so again sending in 1/Gl and multiplying may help.
(In this instance I think you probably need to send both Gl and 1/Gl).
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1136 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARUEWUMFBZKS6ARK77DXHMDUOM63BANCNFSM5I2ZLOTA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
rectification it's " * " symbol and not " / " one sorry.
Also the problem with Cm and Gl is that there exist also formulas with
multiplication, so the two possibilities are keep like this and do the
division or have two more constante with Gl and Cm so 1/Gl and 1/Cm.
Have a nice day
Thomas
Le lun. 29 nov. 2021 à 13:44, thomas garandel ***@***.***> a
écrit :
… Hi Andrew,
yes I noticed before sending to the remote that I could do these
modifications, that I did on another branch on my local repo.
The problem is that it overflowed more with multiplication than with
division.
I think that the main reason is because the multiplication selected for
that is a too big memory needed.
So my question is, could I select one particular multiplication without
writing the name of the function and passing to " / "
symbol?
On the division side I wonder also if I could use divergente series in
order to approximate the result efficiently?
Same idea for the square root but I didn't know any divergente series for
the square root, yet!! ^^
I was fight with this issue so sending this intermediate code was a step
in order to know the procedure.
But now that I know it, I will send it to you when the job is done.
Sincerely
Thomas
Le lun. 29 nov. 2021 à 10:04, Andrew Gait ***@***.***> a
écrit :
> ***@***.**** requested changes on this pull request.
>
> This looks in general fine to me; there are a few considerations you can
> make (see comments) as to where you can avoid some divides. I don't think
> these will help hugely with making enough space to use sqrtk() - we may
> have to think of another way around that. But I would be happy to merge
> this once you've addressed the comments and we can discuss what might be
> possible for sqrtk() after that.
> ------------------------------
>
> In neural_modelling/src/meanfield/models/meanfield_model_impl.c
> <#1136 (comment)>
> :
>
> > - + config->P2*(config->sV-config->sV0)/config->DsV0\
> - + config->P3*(config->TvN-config->TvN0)/config->DTvN0\
> - + config->P5*((config->muV-config->muV0)/config->DmuV0)*((config->muV-config->muV0)/config->DmuV0)\
> - + config->P6*((config->sV-config->sV0)/config->DsV0)*((config->sV-config->sV0)/config->DsV0)\
> - + config->P7*((config->TvN-config->TvN0)/config->DTvN0)*((config->TvN-config->TvN0)/config->DTvN0)\
> - + config->P8*(config->muV-config->muV0)/config->DmuV0*(config->sV-config->sV0)/config->DsV0\
> - + config->P9*(config->muV-config->muV0)/config->DmuV0*(config->TvN-config->TvN0)/config->DTvN0\
> - + config->P10*(config->sV-config->sV0)/config->DsV0*(config->TvN-config->TvN0)/config->DTvN0;
> - */
> -
> - config->Vthre = config->P0;
> -
> - //return config->Vthre;
> +
> + Vthre = P0\
> + + P1*(muV-muV0)/DmuV0\
>
> DmuV0, DsV0 and DTvN0 are all parameters that come directly from constant
> values in python - you can avoid the divides here in this function by
> instead sending in 1/DmuV0 etc. and multiplying.
> ------------------------------
>
> In neural_modelling/src/meanfield/models/meanfield_model_impl.c
> <#1136 (comment)>
> :
>
> > @@ -251,121 +236,153 @@ void get_fluct_regime_varsup(REAL Ve, REAL Vi, config_t *restrict params)
> {
> Fi += ACS_DBL_TINY;
> }
> +
> + REAL Tv = ( Fe*(Ue*Te)*(Ue*Te) + Fi*(Ti*Ui)*(Ti*Ui))\
> + /(Fe*(Ue*Te)*(Ue*Te)/(Te+Tm) + Fi*(Ti*Ui)*(Ti*Ui)/(Ti+Tm));
> +
> + if (Tv < ACS_DBL_TINY){
> + Tv += ACS_DBL_TINY;
> + }
> +
> + pNetwork->TvN = Tv*Gl/Cm; // Thomas : Heu, useless no?? |resp-> TvN is a dimensional so usefull var
>
> Worth considering 1/Cm here too.
> ------------------------------
>
> In neural_modelling/src/meanfield/models/meanfield_model_impl.c
> <#1136 (comment)>
> :
>
> >
> - params->muV = (muGe*params->Ee+muGi*params->Ei+params->Gl*params->El); //fake one
> + pNetwork->muGn = muG/Gl;
>
> Here Gl is a constant, so again sending in 1/Gl and multiplying may help.
> (In this instance I think you probably need to send both Gl and 1/Gl).
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <#1136 (review)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ARUEWUMFBZKS6ARK77DXHMDUOM63BANCNFSM5I2ZLOTA>
> .
> Triage notifications on the go with GitHub Mobile for iOS
> <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
> or Android
> <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
>
>
|
I would like put this on the meanfield_model branch.
That's working in the first order except that sigma_V is not yet to the sqrtk().
I couldn't add sqrtk() because otherwise I overflowed ITCM.