51 double wmax = 10*gamma*w;
53 double sparseness = 0.02 ;
58 double tau_stdp = 20e-3 ;
59 bool stdp_active =
false;
60 bool poisson_stim =
false;
64 double bg_current = 2e-2;
66 double poisson_rate = 100.;
67 double sparseness_afferents = 0.05;
70 double simtime = 1000. ;
74 string infilename =
"";
75 string outputfile =
"out";
76 string netstatfile =
"";
84 po::options_description desc(
"Allowed options");
86 (
"help",
"produce help message")
87 (
"quiet",
"quiet mode")
88 (
"load", po::value<string>(),
"input weight matrix")
89 (
"out", po::value<string>(),
"output filename")
90 (
"stimfile", po::value<string>(),
"stimulus file")
91 (
"eta", po::value<double>(),
"learning rate")
92 (
"kappa", po::value<double>(),
"target rate")
93 (
"simtime", po::value<double>(),
"simulation time")
94 (
"active", po::value<bool>(),
"toggle learning")
95 (
"poisson", po::value<bool>(),
"toggle poisson stimulus")
96 (
"winh", po::value<double>(),
"inhibitory weight multiplier")
97 (
"wei", po::value<double>(),
"ei weight multiplier")
98 (
"chi", po::value<double>(),
"chi current multiplier")
99 (
"seed", po::value<int>(),
"random seed")
102 po::variables_map vm;
103 po::store(po::parse_command_line(ac, av, desc), vm);
106 if (vm.count(
"help")) {
107 std::cout << desc <<
"\n";
111 if (vm.count(
"quiet")) {
115 if (vm.count(
"load")) {
116 std::cout <<
"input weight matrix " 117 << vm[
"load"].as<
string>() <<
".\n";
118 infilename = vm[
"load"].as<
string>();
121 if (vm.count(
"out")) {
122 std::cout <<
"output filename " 123 << vm[
"out"].as<
string>() <<
".\n";
124 outputfile = vm[
"out"].as<
string>();
127 if (vm.count(
"stimfile")) {
128 std::cout <<
"stimfile filename " 129 << vm[
"stimfile"].as<
string>() <<
".\n";
130 stimfile = vm[
"stimfile"].as<
string>();
133 if (vm.count(
"eta")) {
134 std::cout <<
"eta set to " 135 << vm[
"eta"].as<
double>() <<
".\n";
136 eta = vm[
"eta"].as<
double>();
139 if (vm.count(
"kappa")) {
140 std::cout <<
"kappa set to " 141 << vm[
"kappa"].as<
double>() <<
".\n";
142 kappa = vm[
"kappa"].as<
double>();
145 if (vm.count(
"simtime")) {
146 std::cout <<
"simtime set to " 147 << vm[
"simtime"].as<
double>() <<
".\n";
148 simtime = vm[
"simtime"].as<
double>();
151 if (vm.count(
"active")) {
152 std::cout <<
"stdp active : " 153 << vm[
"active"].as<
bool>() <<
".\n";
154 stdp_active = vm[
"active"].as<
bool>();
157 if (vm.count(
"poisson")) {
158 std::cout <<
"poisson active : " 159 << vm[
"poisson"].as<
bool>() <<
".\n";
160 poisson_stim = vm[
"poisson"].as<
bool>();
164 if (vm.count(
"winh")) {
165 std::cout <<
"inhib weight multiplier : " 166 << vm[
"winh"].as<
double>() <<
".\n";
167 winh = vm[
"winh"].as<
double>();
170 if (vm.count(
"wei")) {
171 std::cout <<
"ei weight multiplier : " 172 << vm[
"wei"].as<
double>() <<
".\n";
173 wei = vm[
"wei"].as<
double>();
176 if (vm.count(
"chi")) {
177 std::cout <<
"chi multiplier : " 178 << vm[
"chi"].as<
double>() <<
".\n";
179 chi = vm[
"chi"].as<
double>();
182 if (vm.count(
"seed")) {
183 std::cout <<
"seed set to " 184 << vm[
"seed"].as<
int>() <<
".\n";
185 seed = vm[
"seed"].as<
int>();
189 catch(std::exception& e) {
190 std::cerr <<
"error: " << e.what() <<
"\n";
194 std::cerr <<
"Exception of unknown type!\n";
200 std::stringstream oss;
202 string basename = oss.str();
215 con_exte->
seed(seed);
225 gamma*eta,kappa,tau_stdp,wmax,
255 for (
int j = 0; j <
NE ; j++ ) {
259 for (
int j = 0; j <
NI ; j++ ) {
265 if (!stimfile.empty()) {
268 std::ifstream fin(stimfile.c_str());
269 while (!fin.eof() && counter<
NE) {
272 if (poisson_stim==
true) {
273 for (
int i = 0 ; i <
NP ; ++i)
274 con_exte->
set(i,counter,w_ext);
284 if (!infilename.empty()) {
void auryn_free()
Cleanly shuts down Auryn simulation environment.
Definition: auryn_global.cpp:107
Implements a symmetric STDP window with an optional presynaptic offset as used for inhibitory plastic...
Definition: SymmetricSTDPConnection.h:44
Standard Glutamatergic (excitatory) transmission.
Definition: auryn_definitions.h:139
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
void load_network_state(std::string basename)
Loads network state from a netstate file.
Definition: System.cpp:812
void seed(NeuronID randomseed)
This function seeds the pseudo random number generator for all random fill operatios.
Definition: SparseConnection.cpp:155
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
#define NI
Number of inhibitory neurons.
Definition: sim_isp_orig.cpp:40
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
virtual void set_all(AurynWeight weight)
Sets all weights of existing connections to the given value.
Definition: SparseConnection.cpp:335
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
Conductance based LIF neuron model with absolute refractoriness as used in Vogels and Abbott 2005...
Definition: TIFGroup.h:38
#define NP
Number of Poisson input neurons.
Definition: sim_isp_orig.cpp:41
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_bg_current(NeuronID i, AurynFloat current)
Controls the constant current input (per default set so zero) to neuron i.
Definition: TIFGroup.cpp:121
bool stdp_active
Definition: SymmetricSTDPConnection.h:61
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
virtual void set(NeuronID i, NeuronID j, AurynWeight value)
Sets a single connection to value if it exists.
Definition: SparseConnection.cpp:684
void save_network_state(std::string basename)
Saves network state to a netstate file.
Definition: System.cpp:694
Records from an arbitray state vector of one unit from the source SpikingGroup to a file...
Definition: StateMonitor.h:40
unsigned int NeuronID
NeuronID is an unsigned integeger type used to index neurons in Auryn.
Definition: auryn_definitions.h:151
#define NE
Number of excitatory neurons.
Definition: sim_isp_orig.cpp:39