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

A Checker class that tracks the meain weight of a Connection and breaks a run if it goes out of bound. More...

#include <WeightChecker.h>

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

Public Member Functions

 WeightChecker (Connection *source, AurynFloat max)
 The default constructor. More...
 
 WeightChecker (Connection *source, AurynFloat min, AurynFloat max, AurynFloat timestep=10.0)
 A more elaborate constructor specifying also a minimum weight to guard against silent networks. More...
 
virtual ~WeightChecker ()
 
virtual bool propagate ()
 
- Public Member Functions inherited from auryn::Checker
 Checker ()
 
virtual ~Checker ()
 

Detailed Description

A Checker class that tracks the meain weight of a Connection and breaks a run if it goes out of bound.

Constructor & Destructor Documentation

◆ WeightChecker() [1/2]

WeightChecker::WeightChecker ( Connection source,
AurynFloat  max 
)

The default constructor.

Parameters
sourcethe source group to monitor.
maxthe maximum mean weight above which the Checker signals a break of the simulation.
30  : Checker()
31 {
32  init(source,0.,max,10.);
33 }
Checker()
Definition: Checker.cpp:30

◆ WeightChecker() [2/2]

WeightChecker::WeightChecker ( Connection source,
AurynFloat  min,
AurynFloat  max,
AurynFloat  timestep = 10.0 
)

A more elaborate constructor specifying also a minimum weight to guard against silent networks.

Parameters
sourcethe source group to monitor.
minthe minimum mean weight below which the Checker signals a break of the simulation.
maxthe maximum mean weight above which the Checker signals a break of the simulation.
timestepCheck weights every timestep seconds (default = 10s because weight checking is expensive).
35  : Checker()
36 {
37  init(source,min,max,timestep);
38 }
Checker()
Definition: Checker.cpp:30

◆ ~WeightChecker()

WeightChecker::~WeightChecker ( )
virtual
41 {
42 }
Here is the call graph for this function:

Member Function Documentation

◆ propagate()

bool WeightChecker::propagate ( )
virtual

The propagate function required for internal use.

Implements auryn::Checker.

62 {
63 
64  if ( (sys->get_clock()%timestep_) == 0 ) {
65  AurynDouble mean, std;
66  source_->stats(mean, std);
67  if ( mean<wmin || mean>wmax ) {
68  std::stringstream oss;
69  oss << "WeightChecker:: Detected mean weight of " << mean ;
70  logger->msg(oss.str(),WARNING);
71  return false; // break run
72  }
73  }
74 
75  return true;
76 }
STL namespace.
double AurynDouble
Higher precision floating point datatype.
Definition: auryn_definitions.h:158
Definition: Logger.h:41
virtual void stats(AurynDouble &mean, AurynDouble &std, StateID zid=0)=0
Computes mean synaptic weight and std dev of all weights in this connection.
Logger * logger
Global pointer to instance of Logger which needs to be initialized in every simulation main program...
Definition: auryn_global.cpp:36
System * sys
Global pointer to instance of System which needs to be initialized in every simulation main program...
Definition: auryn_global.cpp:37
void msg(std::string text, LogMessageType type=NOTIFICATION, bool global=false, int line=-1, std::string srcfile="")
Definition: Logger.cpp:74
AurynTime get_clock()
Gets the current clock value in AurynTime.
Definition: System.cpp:231
Here is the call graph for this function:

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