Auryn simulator  v0.8.1-206-gb56e451
Plastic Spiking Neural Network Simulator
TripletConnection.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 TRIPLETCONNECTION_H_
27 #define TRIPLETCONNECTION_H_
28 
29 #include "auryn_definitions.h"
30 #include "AurynVector.h"
31 #include "DuplexConnection.h"
32 #include "Trace.h"
33 #include "LinearTrace.h"
34 #include "SpikeDelay.h"
35 
36 
37 namespace auryn {
38 
49 {
50 
51 private:
52  void virtual_serialize(boost::archive::binary_oarchive & ar, const unsigned int version )
53  {
55  }
56 
57  void virtual_serialize(boost::archive::binary_iarchive & ar, const unsigned int version )
58  {
60  DuplexConnection::compute_reverse_matrix(); // just in case the buffer location has changed
61  }
62 
63  void init(AurynFloat tau_hom, AurynFloat eta, AurynFloat kappa, AurynFloat maxweight);
64  void init_shortcuts();
65 
66  virtual AurynWeight get_hom(NeuronID i);
67 
68 protected:
69 
73 
75 
78 
81 
83 
93  void clip_weight( AurynWeight * weight );
94 
100  void propagate_forward();
101 
108  void propagate_backward();
109 
110 
123 
139 
140 
141 public:
143 
144  /* Definitions of presynaptic traces */
146 
147  /* Definitions of postsynaptic traces */
151 
154 
160  TripletConnection(SpikingGroup * source, NeuronGroup * destination,
161  TransmitterType transmitter=GLUT);
162 
165  TripletConnection(SpikingGroup * source, NeuronGroup * destination,
166  const char * filename,
167  AurynFloat tau_hom=10,
168  AurynFloat eta=1,
169  AurynFloat kappa=3., AurynFloat maxweight=1. ,
170  TransmitterType transmitter=GLUT);
171 
183  TripletConnection(SpikingGroup * source, NeuronGroup * destination,
184  AurynWeight weight, AurynFloat sparseness=0.05,
185  AurynFloat tau_hom=10,
186  AurynFloat eta=1,
187  AurynFloat kappa=3., AurynFloat maxweight=1. ,
188  TransmitterType transmitter=GLUT,
189  string name = "TripletConnection" );
190 
191  virtual ~TripletConnection();
192  virtual void finalize();
193  void free();
194 
195  void set_hom_trace(AurynFloat freq);
196 
197  virtual void propagate();
198  virtual void evolve();
199 
200 };
201 
202 }
203 
204 #endif /*TRIPLETCONNECTION_H_*/
AurynFloat tau_plus
Definition: TripletConnection.h:70
void set_hom_trace(AurynFloat freq)
Definition: TripletConnection.cpp:127
Standard Glutamatergic (excitatory) transmission.
Definition: auryn_definitions.h:139
void propagate_backward()
Back-propagates spikes from post to pre.
Definition: TripletConnection.cpp:190
virtual ~TripletConnection()
Definition: TripletConnection.cpp:121
AurynWeight dw_post(NeuronID pre, NeuronID post)
Event-based weight update upon postsynaptic spike time.
Definition: TripletConnection.cpp:148
Abstract base class of all objects producing spikes.
Definition: SpikingGroup.h:67
virtual void evolve()
Evolve method to update internal connection state. Called by System run method.
Definition: TripletConnection.cpp:224
double AurynDouble
Higher precision floating point datatype.
Definition: auryn_definitions.h:158
AurynFloat AurynWeight
Unit of synaptic weights.
Definition: auryn_definitions.h:159
AurynFloat A3_plus
Definition: TripletConnection.h:142
Abstract base class of synaptic traces.
Definition: Trace.h:36
TripletConnection(SpikingGroup *source, NeuronGroup *destination, TransmitterType transmitter=GLUT)
Empty connection constructor.
Definition: TripletConnection.cpp:82
bool stdp_active
Toggles stdp active/inactive. When inactive traces are still updated, but weights are not...
Definition: TripletConnection.h:153
Trace * tr_post2
Definition: TripletConnection.h:149
NeuronID * fwd_ind
Definition: TripletConnection.h:76
Implements triplet STDP with metaplasticity as described by Pfister and Gerstner 2006.
Definition: TripletConnection.h:48
AurynFloat tau_minus
Definition: TripletConnection.h:71
void compute_reverse_matrix(int z=0)
Definition: DuplexConnection.cpp:113
virtual void propagate()
Internally used propagate method.
Definition: TripletConnection.cpp:218
Definition: ABSConnection.h:38
AurynWeight ** bkw_data
Definition: TripletConnection.h:80
NeuronID * bkw_ind
Definition: TripletConnection.h:79
void virtual_serialize(boost::archive::binary_oarchive &ar, const unsigned int version)
Definition: SparseConnection.h:78
AurynFloat tau_homeostatic
Definition: TripletConnection.h:74
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
void propagate_forward()
Propagates spikes from pre to post.
Definition: TripletConnection.cpp:164
void clip_weight(AurynWeight *weight)
Clips weight to allowed range.
Definition: TripletConnection.cpp:157
AurynWeight dw_pre(NeuronID post)
Basic event-based weight update upon presynaptic spike.
Definition: TripletConnection.cpp:140
AurynFloat tau_long
Definition: TripletConnection.h:72
Abstract base class for all neuron groups.
Definition: NeuronGroup.h:45
AurynDouble hom_fudge
Definition: TripletConnection.h:82
Trace * tr_post
Definition: TripletConnection.h:148
AurynWeight * fwd_data
Definition: TripletConnection.h:77
void free()
Definition: TripletConnection.cpp:78
Trace * tr_pre
Definition: TripletConnection.h:145
Duplex connection is the base class of most plastic connections.
Definition: DuplexConnection.h:54
unsigned int NeuronID
NeuronID is an unsigned integeger type used to index neurons in Auryn.
Definition: auryn_definitions.h:151
Trace * tr_post_hom
Definition: TripletConnection.h:150
virtual void finalize()
Finalizes connection after random or manual initialization of the weights.
Definition: TripletConnection.cpp:73