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

A Checker class that tracks population firing rate as a moving average and breaks a run if it goes out of bound. More...

#include <RateChecker.h>

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

Public Member Functions

 RateChecker (SpikingGroup *source, AurynFloat min, AurynFloat max, AurynFloat tau=1.0)
 
virtual ~RateChecker ()
 
virtual bool propagate ()
 
virtual AurynFloat get_property ()
 
AurynFloat get_rate ()
 
void set_rate (AurynFloat r)
 
void reset ()
 
- Public Member Functions inherited from auryn::Checker
 Checker ()
 
virtual ~Checker ()
 

Protected Attributes

SpikingGroupsrc
 

Detailed Description

A Checker class that tracks population firing rate as a moving average and breaks a run if it goes out of bound.

This class should be specified at least once with all plastic runs to ensure that expoding firing rates or a silent network does not get simulated needlessly for hours.

The different constructors allow to specify different min and max firing rates to guard against too active or quiet networks. Also the timeconstant (tau) over which the moving rate average is computed online can be specified. Allow for 3-5 x tau for the estimate to settle to its steady state value. To avoid accidental breaking of a run due to this effect, at initialization the rate estimate is assumed to be the mean of the min and max. Note further that this checker computes population averages over the fraction of a neuron group which is simulated on a particular rank. In highly parallel simulations when the number of neurons per rank is very the rate estimate might have a high variance accross ranks. If highly parallel simulation is anticipated tau should be chosen longer to avoid spurious breaks caused by a noisy rate estimate or a different checker which computes the rate of entire population (after a MINDELAY s minimal delay) should be used.

Constructor & Destructor Documentation

◆ RateChecker()

RateChecker::RateChecker ( SpikingGroup source,
AurynFloat  min,
AurynFloat  max,
AurynFloat  tau = 1.0 
)

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

Parameters
sourcethe source group to monitor.
minthe minimum firing rate below which the Checker signals a break of the simulation.
maxthe maximum firing rate above which the Checker signals a break of the simulation.
tauthe time constant over which to compute the moving average of the rate.
32  : Checker()
33 {
34  src = source;
35  init(min,max,tau);
36 }
Checker()
Definition: Checker.cpp:30
SpikingGroup * src
Definition: RateChecker.h:73

◆ ~RateChecker()

RateChecker::~RateChecker ( )
virtual
39 {
40 }
Here is the call graph for this function:

Member Function Documentation

◆ get_property()

AurynFloat RateChecker::get_property ( )
virtual

The query function required for internal use.

64 {
65  return get_rate();
66 }
AurynFloat get_rate()
Definition: RateChecker.cpp:68
Here is the call graph for this function:

◆ get_rate()

AurynFloat RateChecker::get_rate ( )

Reads out the current rate estimate.

69 {
70  return state;
71 }

◆ propagate()

bool RateChecker::propagate ( )
virtual

The propagate function required for internal use.

Implements auryn::Checker.

56 {
57  state *= decay_multiplier;
58  state += 1.*src->get_spikes()->size()/timeconstant/size;
59  if ( state>popmin && state<popmax ) return true;
60  else return false;
61 }
SpikeContainer * get_spikes()
Returns pointer to a spike container that contains spikes which arrive in this timestep from all neur...
Definition: SpikingGroup.cpp:245
SpikingGroup * src
Definition: RateChecker.h:73
Here is the call graph for this function:

◆ reset()

void RateChecker::reset ( )
79 {
80  set_rate((popmax+popmin)/2);
81 }
void set_rate(AurynFloat r)
Definition: RateChecker.cpp:73
Here is the call graph for this function:

◆ set_rate()

void RateChecker::set_rate ( AurynFloat  r)

Sets the current rate estimate – for instance to provide a reasonable guess upon init. ( per default this is (max+min)/2.)

74 {
75  state = r;
76 }
r
Definition: mkpat.py:9

Member Data Documentation

◆ src

SpikingGroup* auryn::RateChecker::src
protected

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