Auryn simulator  v0.8.1-206-gb56e451
Plastic Spiking Neural Network Simulator
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
auryn::WeightStatsMonitor Class Reference

Records mean and standard deviation of a weight matrix in predefined intervals. More...

#include <WeightStatsMonitor.h>

Inheritance diagram for auryn::WeightStatsMonitor:
Inheritance graph
[legend]
Collaboration diagram for auryn::WeightStatsMonitor:
Collaboration graph
[legend]

Public Member Functions

 WeightStatsMonitor (Connection *source, string filename, AurynDouble binsize=1.0, NeuronID z=0)
 
virtual ~WeightStatsMonitor ()
 
void execute ()
 

Protected Member Functions

void init (Connection *source, string filename, AurynTime stepsize, NeuronID z)
 
- Protected Member Functions inherited from auryn::Monitor
virtual void open_output_file (std::string filename)
 
virtual void virtual_serialize (boost::archive::binary_oarchive &ar, const unsigned int version)
 
virtual void virtual_serialize (boost::archive::binary_iarchive &ar, const unsigned int version)
 
virtual void flush ()
 Flush to file. More...
 
 Monitor (std::string filename, std::string default_extension="dat")
 Standard constructor with file name. More...
 
 Monitor ()
 Constructor which does not open a text file for output. More...
 
std::string generate_filename (std::string name_hint="")
 Generates a default filename from the device ID. More...
 
virtual ~Monitor ()
 Standard destructor. More...
 
- Protected Member Functions inherited from auryn::Device
void init ()
 Standard initializer to be called by the constructor. More...
 
 Device ()
 Standard constructor. More...
 
void set_name (std::string s)
 Set device name. More...
 
std::string get_name ()
 Get device name. More...
 
int get_id ()
 Get numeric device id. More...
 
virtual ~Device ()
 Standard destructor. More...
 
virtual void evolve ()
 

Protected Attributes

Connectionsrc
 
AurynTime ssize
 
NeuronID z_ind
 
- Protected Attributes inherited from auryn::Monitor
std::ofstream outfile
 
std::string fname
 
std::string default_file_extension
 
bool active
 Standard active switch. More...
 
- Protected Attributes inherited from auryn::Device
std::string device_name
 Identifying name for device. More...
 
bool active
 Standard active switch. More...
 

Detailed Description

Records mean and standard deviation of a weight matrix in predefined intervals.

Constructor & Destructor Documentation

◆ WeightStatsMonitor()

WeightStatsMonitor::WeightStatsMonitor ( Connection source,
std::string  filename,
AurynDouble  binsize = 1.0,
NeuronID  z = 0 
)
30  : Monitor(filename)
31 {
32  init(source,filename,binsize/auryn_timestep,z);
33 }
void init()
Standard initializer to be called by the constructor.
Definition: Device.cpp:32
Monitor()
Constructor which does not open a text file for output.
Definition: Monitor.cpp:47
double auryn_timestep
Simulation timestep in seconds.
Definition: auryn_definitions.cpp:31
Here is the call graph for this function:

◆ ~WeightStatsMonitor()

WeightStatsMonitor::~WeightStatsMonitor ( )
virtual
36 {
37 }

Member Function Documentation

◆ execute()

void WeightStatsMonitor::execute ( )
virtual

Virtual execute function to be called at the end of central simulation loop in System

Reimplemented from auryn::Device.

55 {
56  if (auryn::sys->get_clock()%ssize==0) {
57  AurynDouble mean,std;
58  src->stats(mean,std,z_ind);
59  outfile << (auryn::sys->get_time()) << " " << mean << " " << std << std::endl;
60  }
61 
62 }
NeuronID z_ind
Definition: WeightStatsMonitor.h:47
AurynTime ssize
Definition: WeightStatsMonitor.h:46
STL namespace.
double AurynDouble
Higher precision floating point datatype.
Definition: auryn_definitions.h:158
virtual void stats(AurynDouble &mean, AurynDouble &std, StateID zid=0)=0
Computes mean synaptic weight and std dev of all weights in this connection.
std::ofstream outfile
Definition: Monitor.h:58
System * sys
Global pointer to instance of System which needs to be initialized in every simulation main program...
Definition: auryn_global.cpp:37
AurynDouble get_time()
Gets the current system time in [s].
Definition: System.cpp:226
Connection * src
Definition: WeightStatsMonitor.h:45
Here is the call graph for this function:

◆ init()

void WeightStatsMonitor::init ( Connection source,
std::string  filename,
AurynTime  stepsize,
NeuronID  z 
)
protected
40 {
41  if ( !source->get_destination()->evolve_locally() ) return;
42 
44 
45  src = source;
46  ssize = stepsize;
47  if ( ssize < 1 ) ssize = 1;
48 
49  outfile << std::setiosflags(std::ios::fixed) << std::setprecision(6);
50 
51  z_ind = z;
52 }
NeuronID z_ind
Definition: WeightStatsMonitor.h:47
AurynTime ssize
Definition: WeightStatsMonitor.h:46
NeuronGroup * get_destination()
Returns pointer to the postsynaptic group.
Definition: Connection.cpp:203
bool evolve_locally()
Returns true if the calling instance has units which are integrated on the current rank...
Definition: SpikingGroup.cpp:323
std::ofstream outfile
Definition: Monitor.h:58
void register_device(Device *device)
Registers an instance of Device to the devices vector.
Definition: System.cpp:272
System * sys
Global pointer to instance of System which needs to be initialized in every simulation main program...
Definition: auryn_global.cpp:37
Connection * src
Definition: WeightStatsMonitor.h:45
Here is the call graph for this function:

Member Data Documentation

◆ src

Connection* auryn::WeightStatsMonitor::src
protected

◆ ssize

AurynTime auryn::WeightStatsMonitor::ssize
protected

◆ z_ind

NeuronID auryn::WeightStatsMonitor::z_ind
protected

The documentation for this class was generated from the following files: