Auryn simulator  v0.8.1-206-gb56e451
Plastic Spiking Neural Network Simulator
NormalStimulator.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 
21 #ifndef NORMALSTIMULATOR_H_
22 #define NORMALSTIMULATOR_H_
23 
24 #include "auryn_definitions.h"
25 #include "AurynVector.h"
26 #include "System.h"
27 #include "Logger.h"
28 #include "Monitor.h"
29 #include "NeuronGroup.h"
30 
31 #include <boost/random/mersenne_twister.hpp>
32 #include <boost/random/variate_generator.hpp>
33 #include <boost/random/normal_distribution.hpp>
34 
35 namespace auryn {
36 
42 class NormalStimulator : protected Device
43 {
44 private:
45 
46  static boost::mt19937 gen;
47  boost::normal_distribution<float> * dist;
48  boost::variate_generator<boost::mt19937&, boost::normal_distribution<float> > * die;
49 
50 
52  AurynState * currents;
53 
55  AurynState * newcurrents;
56 
58  auryn_vector_float * target_vector;
59 
61  AurynWeight normal_sigma;
62 
64  void init(NeuronGroup * target, AurynWeight sigma, string target_state);
65 
66  void free();
67 
69  AurynFloat get_lambda();
70 
71 protected:
72 
75 
76 
77 public:
83  NormalStimulator(NeuronGroup * target, AurynWeight sigma=1.0, string target_state="inj_current");
84 
86  virtual ~NormalStimulator();
87 
88 
90  void set_sigma(AurynFloat sigma);
91 
94 
96  void seed(int s);
97 
98 
101  void set_target_state( string state_name = "inj_current" );
102 
104  void execute();
105 
106 };
107 
108 }
109 
110 #endif /*POISSONSTIMULATOR_H_*/
void execute()
Definition: NormalStimulator.cpp:64
void set_target_state(string state_name="inj_current")
Definition: NormalStimulator.cpp:88
AurynFloat AurynWeight
Unit of synaptic weights.
Definition: auryn_definitions.h:159
void init()
Standard initializer to be called by the constructor.
Definition: Device.cpp:32
Definition: ABSConnection.h:38
AurynFloat AurynState
Type for Auryn state variables (default single precision since it needs to be compatible with auryn_v...
Definition: auryn_definitions.h:160
float AurynFloat
Low precision floating point datatype.
Definition: auryn_definitions.h:157
void seed(int s)
Definition: NormalStimulator.cpp:92
Stimulator class to inject timeseries of currents to patterns (subpopulations) of neurons...
Definition: NormalStimulator.h:42
NormalStimulator(NeuronGroup *target, AurynWeight sigma=1.0, string target_state="inj_current")
Definition: NormalStimulator.cpp:27
virtual ~NormalStimulator()
Definition: NormalStimulator.cpp:59
Abstract base class for all neuron groups.
Definition: NeuronGroup.h:45
Default AurynVectorFloat class for performance computation.
Definition: AurynVector.h:796
AurynFloat get_sigma()
Definition: NormalStimulator.cpp:80
void set_sigma(AurynFloat sigma)
Definition: NormalStimulator.cpp:74
NeuronGroup * dst
Definition: NormalStimulator.h:74
Abstract base class for all Device, Stimulator, etc objects.
Definition: Device.h:47