CARLsim  5.0.0
CARLsim: a GPU-accelerated SNN simulator
ConnectionMonitorCore Class Reference

#include <connection_monitor_core.h>

Public Member Functions

 ConnectionMonitorCore (SNN *snn, int monitorId, short int connId, int grpIdPre, int grpIdPost)
 constructor, created by CARLsim::setConnectionMonitor More...
 
 ~ConnectionMonitorCore ()
 destructor, cleans up all the memory upon object deletion More...
 
std::vector< std::vector< float > > calcWeightChanges ()
 calculates weight changes since last snapshot and reports them in 2D weight change matrix More...
 
void clear ()
 deletes data from the 2D weight matrix More...
 
FILE * getConnectFileId ()
 returns pointer to connection file More...
 
short int getConnectId ()
 returns connection ID More...
 
int getFanIn (int neurPostId)
 returns number of incoming synapses to post-synaptic neuron More...
 
int getFanOut (int neurPreId)
 returns number of outgoing synapses of pre-synaptic neuron More...
 
float getMaxWeight (bool getCurrent=false)
 returns max weight in the connection (getCurrent=false: RangeWeight.max, true: current largest) More...
 
float getMinWeight (bool getCurrent=false)
 returns min weight in the connection (getCurrent=false: RangeWeight.min, true: current smallest) More...
 
int getMonitorId ()
 returns ConnectionMonitor ID More...
 
int getNumNeuronsPost ()
 returns number of neurons in post-synaptic group More...
 
int getNumNeuronsPre ()
 returns number of neurons in pre-synaptic group More...
 
int getNumSynapses ()
 returns number of synapses that exist in the connection More...
 
int getNumWeightsChanged (double minAbsChanged=1e-5)
 returns number of weights with >=minAbsChanged weight change since last snapshot More...
 
int getNumWeightsInRange (double minVal, double maxVal)
 returns number of weights with values in range e[minVal,maxVal] (inclusive) More...
 
int getNumWeightsWithValue (double value)
 returns number of weights that have a certain value More...
 
long int getTimeMsCurrentSnapshot ()
 returns the timestamp of the current snapshot (not necessarily CARLsim::getSimTime) More...
 
long int getTimeMsLastSnapshot ()
 returns the timestamp of the last snapshot More...
 
long int getTimeMsSinceLastSnapshot ()
 returns the time passed between current and last snapshot More...
 
double getTotalAbsWeightChange ()
 returns absolute sum of all weight changes since last snapshot More...
 
int getUpdateTimeIntervalSec ()
 
void init ()
 
void print ()
 prints current weight state as 2D matrix (non-existent synapses: NAN, existent but zero weigth: 0.0f) More...
 
void printSparse (int neurPostId=ALL, int maxConn=100, int connPerLine=4, bool storeNewSnapshot=true)
 
void setConnectFileId (FILE *connFileId)
 sets pointer to connection file More...
 
void setUpdateTimeIntervalSec (int intervalSec)
 sets time update interval (seconds) for periodically storing weights to file More...
 
std::vector< std::vector< float > > takeSnapshot ()
 
bool updateTime (int simTimeMs)
 updates timestamp of the snapshots, returns true if update was needed More...
 
void updateWeight (int preId, int postId, float wt)
 updates an entry in the current weight matrix (called by CARLsim::updateConnectionMonitor) More...
 
void writeConnectFileSnapshot (int simTimeMs, std::vector< std::vector< float > > wts)
 writes each snapshot to connect file More...
 

Detailed Description

Definition at line 68 of file connection_monitor_core.h.

Constructor & Destructor Documentation

◆ ConnectionMonitorCore()

ConnectionMonitorCore ( SNN snn,
int  monitorId,
short int  connId,
int  grpIdPre,
int  grpIdPost 
)

Definition at line 62 of file connection_monitor_core.cpp.

◆ ~ConnectionMonitorCore()

Definition at line 121 of file connection_monitor_core.cpp.

Member Function Documentation

◆ calcWeightChanges()

std::vector< std::vector< float > > calcWeightChanges ( )

Definition at line 141 of file connection_monitor_core.cpp.

◆ clear()

void clear ( )

Definition at line 157 of file connection_monitor_core.cpp.

◆ getConnectFileId()

FILE* getConnectFileId ( )
inline

Definition at line 86 of file connection_monitor_core.h.

◆ getConnectId()

short int getConnectId ( )
inline

Definition at line 83 of file connection_monitor_core.h.

◆ getFanIn()

int getFanIn ( int  neurPostId)

Definition at line 167 of file connection_monitor_core.cpp.

◆ getFanOut()

int getFanOut ( int  neurPreId)

Definition at line 179 of file connection_monitor_core.cpp.

◆ getMaxWeight()

float getMaxWeight ( bool  getCurrent = false)

Definition at line 190 of file connection_monitor_core.cpp.

◆ getMinWeight()

float getMinWeight ( bool  getCurrent = false)

Definition at line 215 of file connection_monitor_core.cpp.

◆ getMonitorId()

int getMonitorId ( )
inline

Definition at line 102 of file connection_monitor_core.h.

◆ getNumNeuronsPost()

int getNumNeuronsPost ( )
inline

Definition at line 108 of file connection_monitor_core.h.

◆ getNumNeuronsPre()

int getNumNeuronsPre ( )
inline

Definition at line 105 of file connection_monitor_core.h.

◆ getNumSynapses()

int getNumSynapses ( )
inline

Definition at line 111 of file connection_monitor_core.h.

◆ getNumWeightsChanged()

int getNumWeightsChanged ( double  minAbsChanged = 1e-5)

Definition at line 241 of file connection_monitor_core.cpp.

◆ getNumWeightsInRange()

int getNumWeightsInRange ( double  minVal,
double  maxVal 
)

Definition at line 261 of file connection_monitor_core.cpp.

◆ getNumWeightsWithValue()

int getNumWeightsWithValue ( double  value)

Definition at line 288 of file connection_monitor_core.cpp.

◆ getTimeMsCurrentSnapshot()

long int getTimeMsCurrentSnapshot ( )
inline

Definition at line 123 of file connection_monitor_core.h.

◆ getTimeMsLastSnapshot()

long int getTimeMsLastSnapshot ( )
inline

Definition at line 126 of file connection_monitor_core.h.

◆ getTimeMsSinceLastSnapshot()

long int getTimeMsSinceLastSnapshot ( )
inline

Definition at line 129 of file connection_monitor_core.h.

◆ getTotalAbsWeightChange()

double getTotalAbsWeightChange ( )

Definition at line 298 of file connection_monitor_core.cpp.

◆ getUpdateTimeIntervalSec()

int getUpdateTimeIntervalSec ( )
inline

Definition at line 131 of file connection_monitor_core.h.

◆ init()

void init ( )

initialization method depends on several SNN data structures, so it has be to called at the end of setConnectionMonitor (or later)

Definition at line 85 of file connection_monitor_core.cpp.

◆ print()

void print ( )

Definition at line 312 of file connection_monitor_core.cpp.

◆ printSparse()

void printSparse ( int  neurPostId = ALL,
int  maxConn = 100,
int  connPerLine = 4,
bool  storeNewSnapshot = true 
)

prints current weight state as sparse list of (only allocated, existent) synapses give the option not to store the newly acquired snapshot (for printStatusConnectionMonitor); don't expose to user level

Definition at line 342 of file connection_monitor_core.cpp.

◆ setConnectFileId()

void setConnectFileId ( FILE *  connFileId)

Definition at line 415 of file connection_monitor_core.cpp.

◆ setUpdateTimeIntervalSec()

void setUpdateTimeIntervalSec ( int  intervalSec)

Definition at line 432 of file connection_monitor_core.cpp.

◆ takeSnapshot()

std::vector< std::vector< float > > takeSnapshot ( )

takes snapshot of current weight state and returns 2D matrix (non-existent synapses: NAN, existent but zero weight: 0.0f).

Definition at line 450 of file connection_monitor_core.cpp.

◆ updateTime()

bool updateTime ( int  simTimeMs)

◆ updateWeight()

void updateWeight ( int  preId,
int  postId,
float  wt 
)

◆ writeConnectFileSnapshot()

void writeConnectFileSnapshot ( int  simTimeMs,
std::vector< std::vector< float > >  wts 
)

Definition at line 518 of file connection_monitor_core.cpp.


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