examples:sim_background
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
examples:sim_background [2014/01/20 11:21] – [How to run the code] zenke | examples:sim_background [2014/03/20 09:04] (current) – adds external link zenke | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== sim_background ====== | ====== sim_background ====== | ||
- | This simulation was used in Zenke et al. 2013 to study the stability of the asynchronous irregular background state in a balanced network in the presence of [[manual: | + | This simulation |
{{: | {{: | ||
Line 18: | Line 18: | ||
===== The important bits ===== | ===== The important bits ===== | ||
+ | Similar to other network simulations such as [[sim_isp_orig]] we start by defining two [[manual: | ||
+ | |||
+ | <code c++> | ||
+ | NeuronGroup * neurons_e; | ||
+ | if ( adapt ) { | ||
+ | neurons_e = new AIFGroup(ne); | ||
+ | ((AIFGroup*)neurons_e)-> | ||
+ | ((AIFGroup*)neurons_e)-> | ||
+ | } else { | ||
+ | if ( loadbalance ) | ||
+ | neurons_e = new IFGroup(ne, | ||
+ | else | ||
+ | neurons_e = new IFGroup(ne); | ||
+ | ((IFGroup*)neurons_e)-> | ||
+ | } | ||
+ | IFGroup * neurons_i = new IFGroup(ni); | ||
+ | |||
+ | // initialize membranes | ||
+ | neurons_i-> | ||
+ | neurons_e-> | ||
+ | neurons_i-> | ||
+ | |||
+ | ((IFGroup*)neurons_i)-> | ||
+ | </ | ||
+ | |||
+ | The non-plastic connections between the different neuron groups are set up in this section | ||
+ | <code c++> | ||
+ | msg = " | ||
+ | logger-> | ||
+ | SparseConnection * con_ie = new SparseConnection(neurons_i, | ||
+ | w_ie, | ||
+ | SparseConnection * con_ii = new SparseConnection(neurons_i, | ||
+ | w_ii, | ||
+ | |||
+ | msg = " | ||
+ | logger-> | ||
+ | SparseConnection * con_ei; | ||
+ | if ( !ei_plastic ) { | ||
+ | con_ei = new SparseConnection(neurons_e, | ||
+ | w_ei, sparseness, | ||
+ | } else { | ||
+ | if (infilename.empty()) { | ||
+ | con_ei = new TripletConnection(neurons_e, | ||
+ | w_ei, sparseness, | ||
+ | tau_hom, eta, kappa, wmax, GLUT); | ||
+ | } else { | ||
+ | string str; | ||
+ | str = infilename; | ||
+ | str += " | ||
+ | stringstream oss; | ||
+ | oss << " | ||
+ | logger-> | ||
+ | con_ei = new TripletConnection(neurons_e, | ||
+ | str.c_str(), | ||
+ | tau_hom, eta, kappa, wmax, GLUT); | ||
+ | } | ||
+ | } | ||
+ | |||
+ | </ | ||
+ | |||
+ | |||
+ | Finally triplet STDP is setup here. The code again looks a bit more complicated since the simulation supports the use of different flavours of [[manual: | ||
+ | <code c++> | ||
+ | TripletConnection * con_ee; | ||
+ | |||
+ | if (infilename.empty()) { | ||
+ | if (decay) | ||
+ | con_ee = new TripletDecayConnection(neurons_e, | ||
+ | w_ee, sparseness, | ||
+ | tau_hom, eta, tau_decay, | ||
+ | kappa, wdecay, wmax, GLUT); | ||
+ | else | ||
+ | con_ee = new TripletConnection(neurons_e, | ||
+ | w_ee, sparseness, | ||
+ | tau_hom, eta, kappa, wmax, GLUT); | ||
+ | |||
+ | // con_ee-> | ||
+ | if ( noisyweights ) | ||
+ | con_ee-> | ||
+ | for ( int i = 0 ; i < n_strengthen ; ++i ) { | ||
+ | con_ee-> | ||
+ | } | ||
+ | } | ||
+ | else { | ||
+ | string str; | ||
+ | str = infilename; | ||
+ | str += " | ||
+ | stringstream oss; | ||
+ | oss << " | ||
+ | logger-> | ||
+ | if (decay) | ||
+ | con_ee = new TripletDecayConnection(neurons_e, | ||
+ | str.c_str(), | ||
+ | else | ||
+ | con_ee = new TripletConnection(neurons_e, | ||
+ | str.c_str(), | ||
+ | |||
+ | |||
+ | sprintf(strbuf, | ||
+ | neurons_e-> | ||
+ | sprintf(strbuf, | ||
+ | neurons_i-> | ||
+ | |||
+ | // primetime = 0; | ||
+ | } | ||
+ | |||
+ | </ | ||
examples/sim_background.1390216886.txt.gz · Last modified: 2014/01/20 11:21 by zenke