Auryn simulator  v0.8.1-206-gb56e451
Plastic Spiking Neural Network Simulator
Trace.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 TRACE_H_
27 #define TRACE_H_
28 
29 #include "AurynVector.h"
30 #include "auryn_definitions.h"
31 
32 namespace auryn {
33 
36 class Trace : public AurynStateVector
37 {
38 private:
39  typedef AurynStateVector super;
40 
41 protected:
44 
45 public:
47  Trace(NeuronID n, AurynFloat timeconstant);
48 
50  virtual ~Trace();
51 
56  virtual void inc(NeuronID i);
57 
62  virtual void inc(SpikeContainer * sc);
63 
65  virtual void evolve() = 0;
66 
68  virtual void set_timeconstant( AurynFloat timeconstant );
69 
72 
78 
80  virtual AurynStateVector * get_state_ptr();
81 
83  virtual void set_target( AurynStateVector * target ) = 0;
84 
86  virtual void follow() = 0;
87 
89  virtual void follow(AurynVectorFloat * v, const float rate) { super::follow(v, rate); }
90 };
91 
92 
93 } // namespace
94 
95 #endif /*TRACE_H_*/
96 
virtual void evolve()=0
Perform Euler step.
virtual void set_timeconstant(AurynFloat timeconstant)
Set the time constant of the trace.
Definition: Trace.cpp:41
virtual AurynStateVector * get_state_ptr()
Get pointer to state AurynStateVector for fast processing.
Definition: Trace.cpp:51
std::vector< NeuronID > SpikeContainer
Spike container type. Used for storing spikes.
Definition: auryn_definitions.h:161
AurynFloat tau
Definition: Trace.h:43
virtual AurynFloat normalized_get(NeuronID i)
Get trace value of trace dived by tau.
Definition: Trace.cpp:67
Abstract base class of synaptic traces.
Definition: Trace.h:36
int n
Definition: mkpat.py:5
virtual void follow()=0
Follow target state vector.
Trace(NeuronID n, AurynFloat timeconstant)
Default constructor.
Definition: Trace.cpp:32
virtual void inc(NeuronID i)
Increment given trace by 1.
Definition: Trace.cpp:56
Definition: ABSConnection.h:38
float AurynFloat
Low precision floating point datatype.
Definition: auryn_definitions.h:157
virtual void set_target(AurynStateVector *target)=0
Set the target vector for follow operation.
virtual void follow(AurynVectorFloat *v, const float rate)
Follow other vector.
Definition: Trace.h:89
virtual ~Trace()
Default destructor.
Definition: Trace.cpp:37
AurynFloat get_tau()
Get decay time constant.
Definition: Trace.cpp:46
Default AurynVectorFloat class for performance computation.
Definition: AurynVector.h:796
void follow(AurynVectorFloat *v, const float rate)
Definition: AurynVector.cpp:294
unsigned int NeuronID
NeuronID is an unsigned integeger type used to index neurons in Auryn.
Definition: auryn_definitions.h:151