Auryn simulator  v0.8.1-206-gb56e451
Plastic Spiking Neural Network Simulator
RateModulatedConnection.h
Go to the documentation of this file.
1 /*
2 * Copyright 2014-2018 Friedemann Zenke
3 *
4 * This file is part of Auryn, a simulation package for plastic
5 * spiking neural networks.
6 *
7 * Auryn is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * Auryn is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with Auryn. If not, see <http://www.gnu.org/licenses/>.
19 *
20 * If you are using Auryn or parts of it for your work please cite:
21 * Zenke, F. and Gerstner, W., 2014. Limits to high-speed simulations
22 * of spiking neural networks using general-purpose computers.
23 * Front Neuroinform 8, 76. doi: 10.3389/fninf.2014.00076
24 */
25 
26 #ifndef RATEMODULATEDCONNECTION_H_
27 #define RATEMODULATEDCONNECTION_H_
28 
29 #include "auryn_definitions.h"
30 #include "AurynVector.h"
31 #include "SparseConnection.h"
32 #include "SimpleMatrix.h"
33 
34 #include <boost/random/mersenne_twister.hpp>
35 #include <boost/random/uniform_int.hpp>
36 #include <boost/random/variate_generator.hpp>
37 #include <boost/random/exponential_distribution.hpp>
38 
39 #include <boost/serialization/vector.hpp>
40 #include <boost/serialization/map.hpp>
41 
42 #include <boost/archive/text_oarchive.hpp>
43 #include <boost/archive/text_iarchive.hpp>
44 #include <boost/archive/binary_oarchive.hpp>
45 #include <boost/archive/binary_iarchive.hpp>
46 
47 namespace auryn {
48 
49 typedef SimpleMatrix<AurynWeight*> BackwardMatrix;
50 
52 // on the averaged rate of a given SpikingGropu (rate_modulating_group).
53 //
54 // Rate modulation is happening with a global scaling factor (rate_modulation_mul) that
55 // is set to be rate_modulation_mul = pow(rate_estimate/rate_target,rate_modulation_exponent).
56 // Negative exponants are possible. Default behavior is optimized for GABA-ergic connections
57 // (i.e. positive exponent of 2 increases connection strength if the rate is higher).
58 //*/
60 {
61 private:
62  AurynDouble rate_estimate_tau;
63  AurynDouble rate_estimate_decay_mul;
64 
65  AurynDouble rate_modulation_scale;
66  SpikingGroup * rate_modulating_group;
67 
68  void init();
69  void free();
70 
72  AurynDouble eta;
73 
74 public:
81 
84 
85  RateModulatedConnection(const char * filename);
88  SpikingGroup * source,
89  NeuronGroup * destination,
90  TransmitterType transmitter=GLUT);
92  SpikingGroup * source,
93  NeuronGroup * destination,
94  const char * filename ,
95  TransmitterType transmitter=GLUT);
97  SpikingGroup * source,
98  NeuronGroup * destination,
99  AurynWeight weight,
100  AurynFloat sparseness=0.05,
101  TransmitterType transmitter=GLUT,
102  string name="RateModulatedConnection");
103  virtual ~RateModulatedConnection();
104 
105  virtual void stats(AurynDouble &mean, AurynDouble &std);
106 
107  void set_eta(AurynFloat value);
108 
109  void propagate_forward();
110  void propagate();
111  void evolve();
112  void set_modulating_group(SpikingGroup * group);
113 
114  virtual bool load_from_file(string filename);
115  virtual bool write_to_file(string filename);
116 };
117 
118 }
119 
120 #endif /*RATEMODULATEDCONNECTION_H_*/
AurynDouble rate_modulation_exponent
Definition: RateModulatedConnection.h:80
Rate Modulated Connection implements a SparseConnection in which the weights depend.
Definition: RateModulatedConnection.h:59
AurynDouble rate_modulation_mul
Definition: RateModulatedConnection.h:83
Standard Glutamatergic (excitatory) transmission.
Definition: auryn_definitions.h:139
AurynDouble rate_estimate
Definition: RateModulatedConnection.h:76
void propagate_forward()
Definition: RateModulatedConnection.cpp:91
STL namespace.
Abstract base class of all objects producing spikes.
Definition: SpikingGroup.h:67
double AurynDouble
Higher precision floating point datatype.
Definition: auryn_definitions.h:158
AurynFloat AurynWeight
Unit of synaptic weights.
Definition: auryn_definitions.h:159
The base class to create sparse random connections.
Definition: SparseConnection.h:66
RateModulatedConnection(const char *filename)
Definition: RateModulatedConnection.cpp:52
bool stdp_active
Definition: RateModulatedConnection.h:75
void set_eta(AurynFloat value)
Definition: RateModulatedConnection.cpp:135
virtual ~RateModulatedConnection()
Definition: RateModulatedConnection.cpp:122
Definition: ABSConnection.h:38
virtual bool write_to_file(string filename)
Writes rank specific default weight matrix on the same rank to a file.
Definition: RateModulatedConnection.cpp:147
void propagate()
Internally used propagate method.
Definition: RateModulatedConnection.cpp:105
TransmitterType
Specifies the different transmitter types that Auryn knows.
Definition: auryn_definitions.h:138
float AurynFloat
Low precision floating point datatype.
Definition: auryn_definitions.h:157
SimpleMatrix< AurynWeight * > BackwardMatrix
Definition: DuplexConnection.h:42
AurynDouble rate_target
Definition: RateModulatedConnection.h:78
void set_modulating_group(SpikingGroup *group)
Definition: RateModulatedConnection.cpp:129
virtual bool load_from_file(string filename)
Loads weight matrix from Matrix Market (wmat) file.
Definition: RateModulatedConnection.cpp:169
Abstract base class for all neuron groups.
Definition: NeuronGroup.h:45
virtual void stats(AurynDouble &mean, AurynDouble &std)
Computes mean and variance of weights in default weight matrix.
Definition: RateModulatedConnection.cpp:140
void evolve()
Evolve method to update internal connection state. Called by System run method.
Definition: RateModulatedConnection.cpp:110
unsigned int NeuronID
NeuronID is an unsigned integeger type used to index neurons in Auryn.
Definition: auryn_definitions.h:151