Auryn simulator  v0.8.1-206-gb56e451
Plastic Spiking Neural Network Simulator
IdentityConnection.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 IDENTITYCONNECTION_H_
27 #define IDENTITYCONNECTION_H_
28 
29 #include "auryn_definitions.h"
30 #include "AurynVector.h"
31 #include "Connection.h"
32 #include "System.h"
33 
34 #include <sstream>
35 #include <fstream>
36 #include <stdio.h>
37 
38 #include <boost/random/mersenne_twister.hpp>
39 #include <boost/random/uniform_int.hpp>
40 #include <boost/random/variate_generator.hpp>
41 #include <boost/random/exponential_distribution.hpp>
42 #include <boost/random/normal_distribution.hpp>
43 
44 namespace auryn {
45 
48 {
49 private:
50  SpikeContainer * spikes;
51  void init(AurynWeight weight);
52  AurynWeight connection_weight;
53  NeuronID lo_src,hi_src,lo_dst,hi_dst;
54  NeuronID offset;
55  NeuronID every;
56 
57 protected:
58  void free();
59 
60 
61 public:
63  IdentityConnection(SpikingGroup * source, NeuronGroup * destination, AurynWeight weight = 1.0, TransmitterType transmitter = GLUT, string name = "Default IdentityConnection");
64  IdentityConnection(SpikingGroup * source, NeuronGroup * destination, AurynWeight weight, NeuronID lo_row, NeuronID hi_row, NeuronID lo_col, NeuronID hi_col, TransmitterType transmitter=GLUT, string name = "Cropped Identity Connection" );
65  virtual ~IdentityConnection();
66 
67  virtual AurynWeight get(NeuronID i, NeuronID j);
68  virtual AurynWeight * get_ptr(NeuronID i, NeuronID j);
69  virtual AurynWeight get_data(NeuronID i);
70  void set_offset(int off);
71  void set_every(NeuronID e);
72  virtual void set_data(NeuronID i, AurynWeight value);
73  virtual void set(NeuronID i, NeuronID j, AurynWeight value);
74  void finalize();
76  virtual void propagate();
77 
78  virtual AurynDouble sum();
82  virtual void stats(AurynDouble &mean, AurynDouble &std, StateID zid = 0);
83  virtual bool write_to_file(string filename);
84  virtual bool load_from_file(string filename);
85  virtual AurynFloat mean();
86 
88  std::vector<neuron_pair> get_block(NeuronID lo_row, NeuronID lo_col, NeuronID hi_row, NeuronID hi_col);
89 
90 };
91 
92 }
93 
94 #endif /*IDENTITYCONNECTION_H_*/
std::vector< neuron_pair > get_block(NeuronID lo_row, NeuronID lo_col, NeuronID hi_row, NeuronID hi_col)
Definition: IdentityConnection.cpp:147
Standard Glutamatergic (excitatory) transmission.
Definition: auryn_definitions.h:139
virtual bool load_from_file(string filename)
Implements load from file functionality. Also called in save_network_state from System class...
Definition: IdentityConnection.cpp:141
virtual AurynWeight get_data(NeuronID i)
Return weight element as index in data array.
Definition: IdentityConnection.cpp:95
virtual ~IdentityConnection()
Definition: IdentityConnection.cpp:54
The abstract base class for all Connection objects in Auryn.
Definition: Connection.h:53
std::vector< NeuronID > SpikeContainer
Spike container type. Used for storing spikes.
Definition: auryn_definitions.h:161
void set_every(NeuronID e)
Definition: IdentityConnection.cpp:176
virtual void set_data(NeuronID i, AurynWeight value)
Definition: IdentityConnection.cpp:100
STL namespace.
Abstract base class of all objects producing spikes.
Definition: SpikingGroup.h:67
void finalize()
Finalize Connection after initialization to prepare for use in simulation.
Definition: IdentityConnection.cpp:77
double AurynDouble
Higher precision floating point datatype.
Definition: auryn_definitions.h:158
AurynFloat AurynWeight
Unit of synaptic weights.
Definition: auryn_definitions.h:159
virtual AurynWeight * get_ptr(NeuronID i, NeuronID j)
Return pointer to weight element i,j if it exists, otherwise return NULL.
Definition: IdentityConnection.cpp:110
virtual AurynFloat mean()
Definition: IdentityConnection.cpp:163
Definition: ABSConnection.h:38
unsigned long AurynLong
An unsigned long type used to count synapses or similar.
Definition: auryn_definitions.h:154
AurynLong get_nonzero()
Return number of nonzero elements in this Connection.
Definition: IdentityConnection.cpp:120
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 set_offset(int off)
Definition: IdentityConnection.cpp:170
virtual void stats(AurynDouble &mean, AurynDouble &std, StateID zid=0)
Return stats for connection.
Definition: IdentityConnection.cpp:125
virtual AurynDouble sum()
Definition: IdentityConnection.cpp:131
virtual bool write_to_file(string filename)
Implements save to file functionality. Also called in save_network_state from System class...
Definition: IdentityConnection.cpp:136
Abstract base class for all neuron groups.
Definition: NeuronGroup.h:45
virtual void propagate()
Propagate method to propagate spikes. Called by System run method.
Definition: IdentityConnection.cpp:81
unsigned int StateID
StateID is an unsigned integeger type used to index synaptic states in Auryn.
Definition: auryn_definitions.h:153
void free()
Definition: IdentityConnection.cpp:73
unsigned int NeuronID
NeuronID is an unsigned integeger type used to index neurons in Auryn.
Definition: auryn_definitions.h:151
Provides a unity matrix like connectivity.
Definition: IdentityConnection.h:47