genn-team / genn

GeNN is a GPU-enhanced Neuronal Network simulation environment based on code generation for Nvidia CUDA.
http://genn-team.github.io/
GNU Lesser General Public License v2.1
233 stars 57 forks source link

excitory or inhibitory #95

Closed fereshtehvosta closed 7 years ago

fereshtehvosta commented 8 years ago

How to determine for program to consider inhibitory or excitory synapse? There was an example in tutorial 2 which says that the result is because of synapses being inhibitory. Where should I determine the type of synapse for program?

tnowotny commented 8 years ago

Hi, the synapse models are typically conductance based models, i.e. the synaptic current is determined by a conductance times the difference of the current post-synaptic voltage to a "reversal potential". The reversal potential determines whether synapses are inhibitory or excitatory. For excitatory synapses, typically V_rev= 0 mV, for inhibitory synapses, V_rev= -80 mV.

esinyavuz commented 8 years ago

It depends on the model as well. In this example using the model by Izhikevich 2003, the synapses that have inhibitory presynaptic terminals have negative weights.

fereshtehvosta commented 8 years ago

Really thanks..

fereshtehvosta commented 8 years ago

Hi, i want to make a neuronal network of 700 excitatory TRAUBMILES neuron and 300 inhibitory TRAUBMILES neurons, in order to do this i should add two neuron population which have same parameters and initial variable: double p[7]={ 7.15, //gNa: Na conductance in muS 50.0, //ENa: Na equi potential in mV 1.43, //gK: K conductance in muS -95.0, //EK: K equi potential in mV 0.02672, //gl: l conductance in muS -63.563, //El: l equi potential in mV 0.143 // Cmem: member capacity density in nF }; double ini[4]={ -60.0, // member potential V 0.0529324, // prob for Na channel activation m 0.3176767, // prob for not Na channel blocking h 0.5961207, // prob for K channel activation n }; model.addNeuronPopulation("Pop1Exc",700,TRAUBMILES,p,ini); model.addNeuronPopulation("Pop1Inh",300,TRAUBMILES,p,ini); and then make synapses population but i can not understand how i make this population?? please help me??? in Izevich model we can determine the kind of neurons by change in parameres: double IzhExc_ini[6]={ //Izhikevich model initial conditions - excitatory population -65.0, //0 - V 0.0, //1 - U 0.02, // 0 - a 0.2, // 1 - b -65.0, // 2 - c 8.0 // 3 - d };

double IzhInh_ini[6]={ //Izhikevich model initial conditions - inhibitory population -65, //0 - V 0.0, //1 - U 0.02, // 0 - a 0.25, // 1 - b -65.0, // 2 - c 2.0 // 3 - d }; but i don't know in TRAUBMILES model,what parameter should be change in order to determine excitatory or inhibitory? i really need your help.. Sincerely

jamesturner246 commented 8 years ago

Hi fereshtehvosta.

As said earlier, you need to set synapse g (conductance) to a negative value to get inhibitory, and to a positive value for excitatory.

Synapse g is a variable of a synapse group, not a neuron group. As an example, if using the plain NSYNAPSE synapse type, you would pass g to addSynapsePopulation inside the initial value array:

double inOut_initialVal [1] = {
    0.03
};

model.addSynapsePopulation("InOut", NSYNAPSE, ALLTOALL, INDIVIDUALG, NO_DELAY, EXPDECAY, "InGroup", "OutGroup",  inOut_initialVal, inOut_parameters, inOut_postSynInitialVal, inOut_postSynParameters);
fereshtehvosta commented 8 years ago

Really thanks for your response... So, i just need to set negative synaptic conductance in order to determine inhibitory or excitory synapses..and don't need to changad any other parameter or variable!?? You said me that i should change reversal potential from _80 to 0 for changing in type of synapse in my last post in github!?? What i can do!??change synaptic weight or change reversal potential..!?? I really need your help.. در تاریخ ۸ اوت ۲۰۱۶ ۱۴:۰۵، "James Turner" notifications@github.com نوشت:

Hi fereshtehvosta.

As said earlier, you need to set synapse g (conductance) to a negative value to get inhibitory, and to a positive value for excitatory.

Synapse g is a variable of a synapse group, not a neuron group. As an example, if using the plain NSYNAPSE synapse type, you would pass g to addSynapsePopulation inside the initial value array:

double inOut_initialVal [1] = { 0.03 };

model.addSynapsePopulation("InOut", NSYNAPSE, ALLTOALL, INDIVIDUALG, NO_DELAY, EXPDECAY, "InGroup", "OutGroup", inOut_initialVal, inOut_parameters, inOut_postSynInitialVal, inOut_postSynParameters);

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/genn-team/genn/issues/95#issuecomment-238187626, or mute the thread https://github.com/notifications/unsubscribe-auth/ATj4sLXHcjCGVNrpiohJtelrKdp0tgMvks5qdvh0gaJpZM4JOb4e .

esinyavuz commented 8 years ago

It depends on the model.

In the Izhikevich model the excitatory and inhibitory neuron parameters are different but this is because they have different behaviour. Neuron parameters in this example don't define whether the neuron is inhibitory or excitatory, they define how the neuron dynamics evolve in time. For this example, if you want inhibitory synapses you would need to set the conductances to negative values as James pointed out.

Real neurons behave a bit differently. You wouldn't have "negative conductance" in real life. The flow of current is determined by the reversal potential.

In short, in a simplified model like Izhikevich network usually the membrane potential is updated as:

V(t+1)=V(t)+w*dt+...

In a more biologically realistic model (like the mushroom body simulations provided with GeNN) it works like:

V(t+1)=V(t)+w*(E_rev-V(t))*dt+...

You should refer to neuroscience textbooks if you need more details on how this works.

From the modelling point of view, you need to decide how you add the input current to your neuron and write your equations accordingly. You can take a look at $GENN_PATH/lib/src/neuronModels.cc if you want to see how this is done for Izhikevich and Traub-Miles neurons.

fereshtehvosta commented 8 years ago

i think that i get it.. so for my model with TRAUBMILES neurons i should set negative weight for inhibitory synapses: double s_ini[1]={ -0.05, // g:the synaptic conductance value }; and posetive weight for excitory synapses: double s_ini[1]={ +0.05, // g:the synaptic conductance value }; is it right???? i just don't understand the measure of reversal potential ?? double ps_p[2]={ 1.0, // tau_S: decay time constant for S -80.0 //Erev : reversal potential }; or double ps_p[2]={ 1.0, // tau_S: decay time constant for S 0.0 //Erev : reversal potential };

Thanks...

On 8/8/16, Esin Yavuz notifications@github.com wrote:

It depends on the model.

In the Izhikevich model the excitatory and inhibitory neuron parameters are different but this is because they have different behaviour. Neuron parameters don't define whether the neuron is inhibitory or excitatory, they define how the neuron dynamics evolve in time. For this example, if you want inhibitory synapses you would need to set the conductances to negative values as James pointed out.

Real neurons behave a bit differently. You wouldn't have "negative conductance" in real life. The flow of current is determined by the reversal potential.

In short, in a simplified model like Izhikevich network usually the membrane potential is updated as:

V(t+1)=V(t)+w*dt+...

In a more biologically realistic model (like the mushroom body simulations provided with GeNN) it works like:

V(t+1)=V(t)+w*(E_rev-V(t))*dt+...

You should refer to neuroscience textbooks if you need more details on how this works.

For modelling point of view, you need to decide how you add the input current to your neuron and write your equations accordingly. You can take a look at $GENN_PATH/lib/src/neuronModels.cc if you want to see how this is done for Izhikevich and Traub-Miles neurons.


You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/genn-team/genn/issues/95#issuecomment-238208223

esinyavuz commented 8 years ago

If you are using the built-in TRAUBMILES, then no, you need to keep the conductance positive and set the reversal potential to -80 for inhibitory and 0 for excitatory synapses.

fereshtehvosta commented 8 years ago

yes it work in my program and i know about it but i want to have inhibitory and excitatory synapse in my network for instance : i want to make a network of 7excitory synapse and 3 inhibitory so i define my model :

define DT 0.1

include "modelSpec.h"

include "modelSpec.cc"

void modelDefinition(NNmodel &model){ initGeNN(); model.setName("tenHHComModel"); double p[7]={ 7.15, //gNa: Na conductance in muS 50.0, //ENa: Na equi potential in mV 1.43, //gK: K conductance in muS -95.0, //EK: K equi potential in mV 0.02672, //gl: l conductance in muS -63.563, //El: l equi potential in mV 0.143 // Cmem: member capacity density in nF }; double ini[4]={ -60.0, // member potential V 0.0529324, // prob for Na channel activation m 0.3176767, // prob for not Na channel bloccking h 0.5961207, // prob for K channel activation n }; model.addNeuronPopulation("Pop1Exc",7,TRAUBMILES,p,ini); model.addNeuronPopulation("Pop1Inh",3,TRAUBMILES,p,ini); //model.activateDirectInput("Pop1Exc",MATINP); //model.activateDirectInput("Pop1",CONSTINP); //model.setConstInp("Pop1",0.1); double s_ini[1]={ 0.0, // g:the synaptic conductance value }; double s_p=NULL; double ps_ini=NULL; double pEs_p[2]={ 1.0, // tau_S: decay time constant for S 0.0 //Erev : reversal potential }; double pIn_p[2]={ 1.0, // tau_S: decay time constant for S -80.0 //Erev : reversal potential };

model.addSynapsePopulation("Exc-Exc",NSYNAPSE,SPARSE,INDIVIDUALG,NO_DELAY,EXPDECAY,"Pop1Exc","Pop1Exc",s_ini,s_p,ps_ini,pEs_p);
model.addSynapsePopulation("Exc-Inh",NSYNAPSE,SPARSE,INDIVIDUALG,NO_DELAY,EXPDECAY,"Pop1Exc","Pop1Inh",s_ini,s_p,ps_ini,pIn_p);
model.addSynapsePopulation("Inh-Exc",NSYNAPSE,SPARSE,INDIVIDUALG,NO_DELAY,EXPDECAY,"Pop1Inh","Pop1Exc",s_ini,s_p,ps_ini,pEs_p);
model.addSynapsePopulation("Inh-Inh",NSYNAPSE,SPARSE,INDIVIDUALG,NO_DELAY,EXPDECAY,"Pop1Inh","Pop1Inh",s_ini,s_p,ps_ini,pIn_p);
 model.setMaxConn("Exc_Exc",50);
 model.setMaxConn("Exc_Inh",20);
 model.setMaxConn("Inh_Exc",10);
 model.setMaxConn("Inh_Inh",20);

model.finalize();

} and my simulation code is:

include "tenHHComModel.cc"

include "tenHHComModel_CODE/runner.cc"

float* readFromFile(char* fileName, int num1); float* readFromFile(char* fileName, int num21); float* readFromFile(char* fileName, int num3); float* readFromFile(char* fileName, int num22); float* readFromFile(char* fileName, int num4); float* readFromFile(char* fileName, int num23); float* readFromFile(char* fileName, int num5); float* readFromFile(char* fileName, int num25);

int main(){ allocateMem(); initialize(); int num1=50; int num21=11; int num22=11; int num23=11; int num24=11; int num3=20; int num4=10; int num5=20; float* IndExc-Exc = readFromFile("ind1.txt",num1); float* IndGExc-Exc = readFromFile("indG1.txt",num21); float* VarExc-Exc = readFromFile("Var1.txt",num1);

allocateExc-Exc(50);
for(int i=0;i<=50;i++){//forind1
 CExc-Exc.ind[i] = IndExc-Exc[i];
}//endfor ind1
 for(int i=0;i<=11;i++){//forindG1
 CExc-Exc.indInG[i] = IndGExc-Exc[i];
}//endfor indG1
 for(int i=0;i<=50;i++){//forVar1
 CExc-Exc.var[i] = VarExc-Exc[i];
}//endfor Var1

initializeAllSparseArrays(); pushExc-ExcStateToDevice(); float* IndExc-Inh = readFromFile("ind2.txt",num4); float* IndGExc-Inh = readFromFile("indG2.txt",num22); float* VarExc-Inh = readFromFile("Var2.txt",num4);

allocateExc-Inh(10);
for(int i=0;i<=10;i++){//forind2
 CExc-Inh.ind[i] = IndExc-Inh[i];
}//endfor ind2
 for(int i=0;i<=11;i++){//forindG2
 CExc-Inh.indInG[i] = IndGExc-Inh[i];
}//endfor indG2
 for(int i=0;i<=10;i++){//forVar2
 CExc-Inh.var[i] = VarExc-Inh[i];
}//endfor Var2

initializeAllSparseArrays(); pushExc-InhStateToDevice(); float* IndInh-Exc = readFromFile("ind3.txt",num3); float* IndGInh-Exc = readFromFile("indG3.txt",num23); float* VarInh-Exc = readFromFile("Var3.txt",num3);

allocateInh-Exc(20);
for(int i=0;i<=20;i++){//forind3
 CInh-Exc.ind[i] = IndInh-Exc[i];
}//endfor ind3
 for(int i=0;i<=11;i++){//forindG3
 CInh-Exc.indInG[i] = IndGInh-Exc[i];
}//endfor indG3
 for(int i=0;i<=20;i++){//forVar3
 CInh-Exc.var[i] = VarInh-Exc[i];
}//endfor Var3

initializeAllSparseArrays(); pushInh-ExcStateToDevice(); float* IndInh-Inh = readFromFile("ind4.txt",num5); float* IndGInh-Inh = readFromFile("indG4.txt",num24); float* VarInh-Inh = readFromFile("Var4.txt",num5);

allocateInh-Inh(20);
for(int i=0;i<=20;i++){//forind4
 CInh-Inh.ind[i] = IndInh-Inh[i];
}//endfor ind4
 for(int i=0;i<=11;i++){//forindG4
 CInh-Inh.indInG[i] = IndGInh-Inh[i];
}//endfor indG4
 for(int i=0;i<=20;i++){//forVar4
 CInh-Inh.var[i] = VarInh-Inh[i];
}//endfor Var4

initializeAllSparseArrays(); pushInh-InhStateToDevice();

for(float j=0;j<10;j++)

{ stepTimeGPU(1.0);

pullPop1ExcStateFromDevice();
pullPop1InhStateFromDevice();
   //if (j<100) continue;
for( int i=0; i< 10;i++){
    cout << Pop1ExcV[i] << " ";
    cout << Pop1InhV[i] << endl;

} } return 0; }

float* readFromFile(char* fileName, int num1){
ifstream file;
file.open(fileName);
float* IndExc-Exc = new float[num1];

for(int i=0; i<num1; i++){
        float f;
        file >> f;
        IndExc-Exc[i] = f;

}
return IndExc-Exc;
}
float* readFromFile(char* fileName, int num21){
ifstream file;
file.open(fileName);
float* IndGExc-Exc = new float[num21];

for(int i=0; i<num21; i++){
        float f;
        file >> f;
        IndGExc-Exc[i] = f;
        }
return IndGExc-Exc;
}
float* readFromFile(char* fileName, int num1){
ifstream file;
file.open(fileName);
float* VarExc-Exc = new float[num1];

for(int i=0; i<num1; i++){
        float f;
        file >> f;
        VarExc-Exc[i] = f;

}
return VarExc-Exc;
}
float* readFromFile(char* fileName, int num3){
ifstream file;
file.open(fileName);
float* IndInh-Exc = new float[num3];

for(int i=0; i<num3; i++){
        float f;
        file >> f;
        IndInh-Exc[i] = f;
}
return IndInh-Exc;
}
float* readFromFile(char* fileName, int num22){
ifstream file;
file.open(fileName);
float* IndGInh-Exc = new float[num22;

for(int i=0; i<num22; i++){
        float f;
        file >> f;
        IndGInh-Exc[i] = f;
        }
return IndGInh-Exc;
}

float* readFromFile(char* fileName, int num3){
ifstream file;
file.open(fileName);
float* VarInh-Exc = new float[num3];

for(int i=0; i<num3; i++){
        float f;
        file >> f;
        VarInh-Exc[i] = f;

}
return VarInh-Exc;
}
float* readFromFile(char* fileName, int num23){
ifstream file;
file.open(fileName);
float* IndGExc-Inh = new float[num23];

for(int i=0; i<num23; i++){
        float f;
        file >> f;
        IndGExc-Inh[i] = f;
        }
return IndGExc-Inh;
}
float* readFromFile(char* fileName, int num4){
ifstream file;
file.open(fileName);
float* IndExc-Inh = new float[num4];

for(int i=0; i<num4; i++){
        float f;
        file >> f;
        IndExc-Inh[i] = f;
}
return IndExc-Inh;
}
float* readFromFile(char* fileName, int num4){
ifstream file;
file.open(fileName);
float* VarExc-Inh = new float[num4];

for(int i=0; i<num4; i++){
        float f;
        file >> f;
        VarExc-Inh[i] = f;

}
return VarExc-Inh;
}

float* readFromFile(char* fileName, int num5){
ifstream file;
file.open(fileName);
float* IndInh-Inh = new float[num5];

for(int i=0; i<num5; i++){
        float f;
        file >> f;
        IndInh-Inh[i] = f;
}
return IndInh-Inh;
}

float* readFromFile(char* fileName, int num24){
ifstream file;
file.open(fileName);
float* IndGInh-Inh = new float[num24];

for(int i=0; i<num24; i++){
        float f;
        file >> f;
        IndGInh-Inh[i] = f;
        }
return IndGInh-Inh;
}

float* readFromFile(char* fileName, int num5){
ifstream file;
file.open(fileName);
float* VarInh-Inh = new float[num5];

for(int i=0; i<num5; i++){
        float f;
        file >> f;
        VarInh-Inh[i] = f;

}
return VarInh-Inh;
}

from your point of view, is it true????? Thanks and ُSorry for so many questions that I have.

On 8/8/16, Esin Yavuz notifications@github.com wrote:

If you are using the built-in TRAUBMILES, then no, you need to keep the conductance positive and set the reversal potential to -80 for inhibitory and 0 for excitatory synapses.


You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/genn-team/genn/issues/95#issuecomment-238246051