Auryn simulator  v0.8.1-206-gb56e451
Plastic Spiking Neural Network Simulator
WeightPatternMonitor.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 WEIGHTPATTERNMONITOR_H_
27 #define WEIGHTPATTERNMONITOR_H_
28 
29 #include "auryn_definitions.h"
30 #include "AurynVector.h"
31 #include "Monitor.h"
32 #include "System.h"
33 #include "Connection.h"
34 #include <fstream>
35 #include <iomanip>
36 
37 namespace auryn {
38 
43 class WeightPatternMonitor : protected Monitor
44 {
45 protected:
48 
49 
50 
51  std::vector<type_pattern> pre_patterns;
52  std::vector<type_pattern> post_patterns;
53 
54 
55  void init(Connection * source, string filename, AurynTime stepsize);
57 
59  void load_patterns(std::string filename, std::vector<type_pattern> & patterns );
60 
61 public:
63 size_t max_patterns;
64 
65  WeightPatternMonitor(Connection * source, string filename, AurynDouble binsize=10.0);
66 
69  void load_pre_patterns(string filename );
72  void load_post_patterns(string filename );
74  void load_patterns(string filename );
75 
76  virtual ~WeightPatternMonitor();
77  void execute();
78 };
79 
80 }
81 
82 #endif /*WEIGHTPATTERNMONITOR_H_*/
void load_post_patterns(string filename)
Definition: WeightPatternMonitor.cpp:165
void load_patterns(std::string filename, std::vector< type_pattern > &patterns)
Definition: WeightPatternMonitor.cpp:95
Abstract base class for all Monitor objects.
Definition: Monitor.h:47
Records mean weights from a connection specified by one or two pattern files. Can be used to easily m...
Definition: WeightPatternMonitor.h:43
AurynWeight compute_pattern_mean(const NeuronID i, const NeuronID j)
Definition: WeightPatternMonitor.cpp:55
The abstract base class for all Connection objects in Auryn.
Definition: Connection.h:53
void execute()
Definition: WeightPatternMonitor.cpp:76
AurynTime ssize
Definition: WeightPatternMonitor.h:47
double AurynDouble
Higher precision floating point datatype.
Definition: auryn_definitions.h:158
AurynFloat AurynWeight
Unit of synaptic weights.
Definition: auryn_definitions.h:159
WeightPatternMonitor(Connection *source, string filename, AurynDouble binsize=10.0)
Definition: WeightPatternMonitor.cpp:30
virtual ~WeightPatternMonitor()
Definition: WeightPatternMonitor.cpp:35
void init()
Standard initializer to be called by the constructor.
Definition: Device.cpp:32
Definition: ABSConnection.h:38
size_t max_patterns
Definition: WeightPatternMonitor.h:63
void load_pre_patterns(string filename)
Definition: WeightPatternMonitor.cpp:160
std::vector< type_pattern > pre_patterns
Definition: WeightPatternMonitor.h:51
Connection * src
Definition: WeightPatternMonitor.h:46
NeuronID AurynTime
Defines Auryns discrete time unit of the System clock. Change to AurynLong if 120h of simtime are not...
Definition: auryn_definitions.h:155
std::vector< type_pattern > post_patterns
Definition: WeightPatternMonitor.h:52
std::string string
Standard library string type which is imported into Auryn namespace.
Definition: auryn_definitions.h:156
unsigned int NeuronID
NeuronID is an unsigned integeger type used to index neurons in Auryn.
Definition: auryn_definitions.h:151