55 double sparseness = 0.05;
59 bool wmatdump =
false;
60 double simtime = 3600.;
61 double stimtime = simtime;
62 double wmat_interval = 600.;
65 double stimfreq = 100;
69 bool noisyweights =
false;
75 double beta_scaling = 1;
82 string infilename =
"";
84 const char * file_prefix =
"bg_scaling";
92 po::options_description desc(
"Allowed options");
94 (
"help",
"produce help message")
95 (
"quiet",
"quiet mode")
96 (
"load", po::value<string>(),
"input weight matrix")
97 (
"wmat",
"wmat dump mode")
98 (
"eta", po::value<double>(),
"learning rate")
99 (
"scaling", po::value<double>(),
"learning rate")
100 (
"tau_hom", po::value<double>(),
"homeostatic time constant")
101 (
"kappa", po::value<double>(),
"target rate")
102 (
"simtime", po::value<double>(),
"simulation time")
103 (
"dir", po::value<string>(),
"output dir")
104 (
"label", po::value<string>(),
"output label")
105 (
"we", po::value<double>(),
"we")
106 (
"strengthen", po::value<int>(),
"connections to strengthen by 10")
107 (
"stimfile", po::value<string>(),
"stimulus ras file")
108 (
"wstim", po::value<double>(),
"weight of stimulus connections")
109 (
"stimtime", po::value<double>(),
"time of stimulus on")
110 (
"adapt",
"adapting excitatory neurons")
111 (
"corr",
"add correlated inputs")
112 (
"stimfreq", po::value<double>(),
"CorrelatedPoissonGroup frequency default = 100")
113 (
"noisyweights",
"enables noisyweights for mean field checks")
114 (
"fast",
"turn off some of the monitors to run faster")
117 po::variables_map vm;
118 po::store(po::parse_command_line(ac, av, desc), vm);
121 if (vm.count(
"help")) {
122 std::cout << desc <<
"\n";
126 if (vm.count(
"quiet")) {
130 if (vm.count(
"load")) {
131 std::cout <<
"load from matrix " 132 << vm[
"load"].as<
string>() <<
".\n";
133 infilename = vm[
"load"].as<
string>();
136 if (vm.count(
"wmat")) {
138 std::cout <<
"wmat dump mode" << std::endl;
141 if (vm.count(
"eta")) {
142 std::cout <<
"eta set to " 143 << vm[
"eta"].as<
double>() <<
".\n";
144 eta = vm[
"eta"].as<
double>();
147 if (vm.count(
"scaling")) {
148 std::cout <<
"scaling set to " 149 << vm[
"scaling"].as<
double>() <<
".\n";
150 beta_scaling = vm[
"scaling"].as<
double>();
153 if (vm.count(
"tau_hom")) {
154 std::cout <<
"tau_hom set to " 155 << vm[
"tau_hom"].as<
double>() <<
".\n";
156 tau_hom = vm[
"tau_hom"].as<
double>();
159 if (vm.count(
"kappa")) {
160 std::cout <<
"kappa set to " 161 << vm[
"kappa"].as<
double>() <<
".\n";
162 kappa = vm[
"kappa"].as<
double>();
165 if (vm.count(
"simtime")) {
166 std::cout <<
"simtime set to " 167 << vm[
"simtime"].as<
double>() <<
".\n";
168 simtime = vm[
"simtime"].as<
double>();
172 if (vm.count(
"corr")) {
173 std::cout <<
"enabling corr " << std::endl;
177 if (vm.count(
"stimfreq")) {
178 std::cout <<
"stimfreq set to " 179 << vm[
"stimfreq"].as<
double>() <<
".\n";
180 stimfreq = vm[
"stimfreq"].as<
double>();
183 if (vm.count(
"dir")) {
184 std::cout <<
"dir set to " 185 << vm[
"dir"].as<
string>() <<
".\n";
186 dir = vm[
"dir"].as<
string>();
189 if (vm.count(
"label")) {
190 std::cout <<
"label set to " 191 << vm[
"label"].as<
string>() <<
".\n";
192 label = vm[
"label"].as<
string>();
195 if (vm.count(
"we")) {
196 std::cout <<
"we set to " 197 << vm[
"we"].as<
double>() <<
".\n";
198 w_ee = vm[
"we"].as<
double>();
201 if (vm.count(
"strengthen")) {
202 std::cout <<
"strengthen set to " 203 << vm[
"strengthen"].as<
int>() <<
".\n";
204 n_strengthen = vm[
"strengthen"].as<
int>();
207 if (vm.count(
"stimfile")) {
208 std::cout <<
"stimfile set to " 209 << vm[
"stimfile"].as<
string>() <<
".\n";
210 stimfile = vm[
"stimfile"].as<
string>();
213 if (vm.count(
"wstim")) {
214 std::cout <<
"wstim set to " 215 << vm[
"wstim"].as<
double>() <<
".\n";
216 wstim = vm[
"wstim"].as<
double>();
219 if (vm.count(
"stimtime")) {
220 std::cout <<
"stimtime set to " 221 << vm[
"stimtime"].as<
double>() <<
".\n";
222 stimtime = vm[
"stimtime"].as<
double>();
225 if (vm.count(
"adapt")) {
226 std::cout <<
"adaptation on " << std::endl;
230 if (vm.count(
"noisyweights")) {
231 std::cout <<
"noisyweights on " << std::endl;
235 if (vm.count(
"fast")) {
236 std::cout <<
"fast on " << std::endl;
240 catch(std::exception& e) {
241 std::cerr <<
"error: " << e.what() <<
"\n";
245 std::cerr <<
"Exception of unknown type!\n";
250 double primetime = 3.0*tau_hom;
255 if (!infilename.empty()) {
256 std::stringstream iss;
258 infilename = iss.str();
268 neurons_e =
new IFGroup(20000);
282 msg =
"Setting up I connections ...";
285 w_ie,sparseness,
GABA);
287 w_ii,sparseness,
GABA);
289 msg =
"Setting up E connections ...";
292 w_ei, sparseness,
GLUT);
296 if (infilename.empty()) {
298 w_ee, sparseness,tau_hom,eta,kappa,beta_scaling,wmax,
GLUT);
301 for (
int i = 0 ; i < n_strengthen ; ++i ) {
302 con_ee->
set_data(i,i*(wmax/n_strengthen));
309 std::stringstream oss;
310 oss <<
"Loading weight matrix from " << str;
313 str.c_str(),tau_hom,eta,kappa,beta_scaling,wmax,
GLUT);
325 msg =
"Initializing traces ...";
332 msg =
"Setting up monitors ...";
336 sprintf(strbuf,
"%s/%s_e%.2et%.2f%s.%d.weight", dir.c_str(), file_prefix, beta_scaling, tau_hom, label.c_str(),
sys->
mpi_rank());
341 sprintf(strbuf,
"%s/%s_e%.2et%.2f%s.%d.%c.ras", dir.c_str(), file_prefix, beta_scaling, tau_hom, label.c_str(),
sys->
mpi_rank(),
'e');
344 sprintf(strbuf,
"%s/%s_e%.2et%.2f%s.%d.%c.prate", dir.c_str(), file_prefix, beta_scaling, tau_hom, label.c_str(),
sys->
mpi_rank(),
'e');
348 sprintf(strbuf,
"%s/%s_e%.2et%.2f%s.%d.syn", dir.c_str(), file_prefix, beta_scaling, tau_hom, label.c_str(),
sys->
mpi_rank());
350 wmon->add_equally_spaced(20);
358 if (!stimfile.empty()) {
359 msg =
"Setting up stimulus ...";
363 con_stim->
set_name(
"Stimulus Connection");
364 con_stim->allocate_manually(4*500*100*sparseness);
365 con_stim->connect_block_random(wstim, sparseness, 0, 500, 0, 100);
366 con_stim->connect_block_random(wstim, sparseness, 500, 1000, 100, 200);
367 con_stim->connect_block_random(wstim, sparseness, 1000, 1500, 200, 300);
368 con_stim->connect_block_random(wstim, sparseness, 1500, 2000, 300, 400);
369 con_stim->finalize();
372 sprintf(strbuf,
"%s/%s_e%.2et%.2f%s.%d_stim.wmat", dir.c_str(), file_prefix, beta_scaling, tau_hom, label.c_str(),
sys->
mpi_rank());
381 sys->run(primetime,
true);
387 std::stringstream oss;
388 oss <<
" Activating correlated input ... ";
409 sprintf(strbuf,
"%s/%s_e%.2et%.2f%s.%d.%c.ras", dir.c_str(), file_prefix, beta_scaling, tau_hom, label.c_str(),
sys->
mpi_rank(),
'c');
419 if (!
sys->run(simtime,
true))
425 sprintf(strbuf,
"%s/%s_e%.2et%.2f%s.%d.e.nstate", dir.c_str(), file_prefix, beta_scaling, tau_hom, label.c_str(),
sys->
mpi_rank());
427 sprintf(strbuf,
"%s/%s_e%.2et%.2f%s.%d.i.nstate", dir.c_str(), file_prefix, beta_scaling, tau_hom, label.c_str(),
sys->
mpi_rank());
431 sprintf(strbuf,
"%s/%s_e%.2et%.2f%s.%d.wmat", dir.c_str(), file_prefix, beta_scaling, tau_hom, label.c_str(),
sys->
mpi_rank());
435 sprintf(strbuf,
"%s/%s_e%.2et%.2f%s.%d.lifetime", dir.c_str(), file_prefix, beta_scaling, tau_hom, label.c_str(),
sys->
mpi_rank());
436 std::ofstream killfile;
437 killfile.open(strbuf);
438 killfile <<
sys->
get_time()-primetime << std::endl;
void auryn_free()
Cleanly shuts down Auryn simulation environment.
Definition: auryn_global.cpp:107
void set_block(NeuronID lo_row, NeuronID hi_row, NeuronID lo_col, NeuronID hi_col, AurynWeight weight)
Sets all weights of existing connections in a block spanned by the first 4 parameters to the value gi...
Definition: SparseConnection.cpp:307
Standard Glutamatergic (excitatory) transmission.
Definition: auryn_definitions.h:139
virtual bool load_from_file(const char *filename)
Reads current states of SpikingGroup to human-readible textfile if implemented in derived class...
Definition: SpikingGroup.cpp:585
virtual void set_data(NeuronID i, AurynWeight value)
Sets weight value of a given element referenced by its index in the data array.
Definition: SparseConnection.cpp:661
void random_mem(AurynState mean=-60e-3, AurynState sigma=5e-3)
Definition: NeuronGroup.cpp:81
unsigned int mpi_rank()
Returns current rank.
Definition: System.cpp:1009
bool stdp_active
Definition: TripletScalingConnection.h:84
Abstract base class of all objects producing spikes.
Definition: SpikingGroup.h:67
AurynFloat AurynWeight
Unit of synaptic weights.
Definition: auryn_definitions.h:159
A Checker class that tracks population firing rate as a moving average and breaks a run if it goes ou...
Definition: RateChecker.h:59
The base class to create sparse random connections.
Definition: SparseConnection.h:66
Logger * logger
Global pointer to instance of Logger which needs to be initialized in every simulation main program...
Definition: auryn_global.cpp:36
The standard Monitor object to record spikes from a SpikingGroup and write them to a text file...
Definition: SpikeMonitor.h:52
void set_tau_mem(AurynFloat taum)
Sets the membrane time constant.
Definition: IFGroup.cpp:154
Saves the weight matrix of a given connection in regular time intervals.
Definition: WeightMatrixMonitor.h:41
void auryn_abort(int errcode)
Terminates Auryn simulation abnormally.
Definition: auryn_global.cpp:113
void random_data(AurynWeight mean, AurynWeight sigma)
Synonym for random_data.
Definition: SparseConnection.cpp:208
System * sys
Global pointer to instance of System which needs to be initialized in every simulation main program...
Definition: auryn_global.cpp:37
A SpikingGroup that creates poissonian spikes with a given rate.
Definition: PoissonGroup.h:52
A simple extension of IFGroup with spike triggered adaptation.
Definition: AIFGroup.h:37
AurynDouble get_time()
Gets the current system time in [s].
Definition: System.cpp:226
void set_hom_trace(AurynFloat freq)
Definition: TripletScalingConnection.cpp:123
void auryn_init(int ac, char *av[], string dir, string simulation_name, string logfile_prefix, LogMessageType filelog_level, LogMessageType consolelog_level)
Initalizes MPI and the Auryn simulation environment.
Definition: auryn_global.cpp:84
void set_beta(AurynFloat beta)
Definition: TripletScalingConnection.cpp:254
Standard Gabaergic (inhibitory) transmission.
Definition: auryn_definitions.h:140
void msg(std::string text, LogMessageType type=NOTIFICATION, bool global=false, int line=-1, std::string srcfile="")
Definition: Logger.cpp:74
Definition: TripletScalingConnection.h:33
Abstract base class for all neuron groups.
Definition: NeuronGroup.h:45
void set_name(std::string s)
Set connection name.
Definition: SpikingGroup.cpp:507
bool write_to_file(ForwardMatrix *m, string filename)
Writes rank specific weight matrix on the same rank to a file.
Definition: SparseConnection.cpp:690
Monitor class to record population firing rates.
Definition: PopulationRateMonitor.h:46
virtual bool write_to_file(const char *filename)
Writes current states of SpikingGroup to human-readible textfile if implemented in derived class...
Definition: SpikingGroup.cpp:549
Monitors the evolution of a single or a set of weights.
Definition: WeightMonitor.h:65
unsigned int NeuronID
NeuronID is an unsigned integeger type used to index neurons in Auryn.
Definition: auryn_definitions.h:151
Implements the standard integrate and file model used in Auryn.
Definition: IFGroup.h:47
Provides a unity matrix like connectivity.
Definition: IdentityConnection.h:47