CARLsim  6.1.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...
 
std::vector< std::vector< float > > getPrevWeights ()
 LN20201118 returns calculates previous weights and reports them in 2D weight matrix. 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 ()
 
std::vector< std::vector< float > > getWeights ()
 LN20201118 returns calculates current and reports them in 2D weight matrix. More...
 
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 70 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 63 of file connection_monitor_core.cpp.

◆ ~ConnectionMonitorCore()

Definition at line 122 of file connection_monitor_core.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ calcWeightChanges()

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

Definition at line 152 of file connection_monitor_core.cpp.

Here is the caller graph for this function:

◆ clear()

void clear ( )

Definition at line 168 of file connection_monitor_core.cpp.

Here is the caller graph for this function:

◆ getConnectFileId()

FILE* getConnectFileId ( )
inline

Definition at line 94 of file connection_monitor_core.h.

Here is the call graph for this function:

◆ getConnectId()

short int getConnectId ( )
inline

Definition at line 91 of file connection_monitor_core.h.

Here is the caller graph for this function:

◆ getFanIn()

int getFanIn ( int  neurPostId)

Definition at line 178 of file connection_monitor_core.cpp.

Here is the caller graph for this function:

◆ getFanOut()

int getFanOut ( int  neurPreId)

Definition at line 190 of file connection_monitor_core.cpp.

Here is the caller graph for this function:

◆ getMaxWeight()

float getMaxWeight ( bool  getCurrent = false)

Definition at line 201 of file connection_monitor_core.cpp.

Here is the caller graph for this function:

◆ getMinWeight()

float getMinWeight ( bool  getCurrent = false)

Definition at line 226 of file connection_monitor_core.cpp.

Here is the caller graph for this function:

◆ getMonitorId()

int getMonitorId ( )
inline

Definition at line 110 of file connection_monitor_core.h.

◆ getNumNeuronsPost()

int getNumNeuronsPost ( )
inline

Definition at line 116 of file connection_monitor_core.h.

Here is the caller graph for this function:

◆ getNumNeuronsPre()

int getNumNeuronsPre ( )
inline

Definition at line 113 of file connection_monitor_core.h.

Here is the caller graph for this function:

◆ getNumSynapses()

int getNumSynapses ( )
inline

Definition at line 119 of file connection_monitor_core.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getNumWeightsChanged()

int getNumWeightsChanged ( double  minAbsChanged = 1e-5)

Definition at line 252 of file connection_monitor_core.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getNumWeightsInRange()

int getNumWeightsInRange ( double  minVal,
double  maxVal 
)

Definition at line 272 of file connection_monitor_core.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getNumWeightsWithValue()

int getNumWeightsWithValue ( double  value)

Definition at line 299 of file connection_monitor_core.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getPrevWeights()

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

Definition at line 147 of file connection_monitor_core.cpp.

Here is the caller graph for this function:

◆ getTimeMsCurrentSnapshot()

long int getTimeMsCurrentSnapshot ( )
inline

Definition at line 131 of file connection_monitor_core.h.

Here is the caller graph for this function:

◆ getTimeMsLastSnapshot()

long int getTimeMsLastSnapshot ( )
inline

Definition at line 134 of file connection_monitor_core.h.

Here is the caller graph for this function:

◆ getTimeMsSinceLastSnapshot()

long int getTimeMsSinceLastSnapshot ( )
inline

Definition at line 137 of file connection_monitor_core.h.

Here is the caller graph for this function:

◆ getTotalAbsWeightChange()

double getTotalAbsWeightChange ( )

Definition at line 309 of file connection_monitor_core.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getUpdateTimeIntervalSec()

int getUpdateTimeIntervalSec ( )
inline

Definition at line 139 of file connection_monitor_core.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getWeights()

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

Definition at line 142 of file connection_monitor_core.cpp.

Here is the caller graph for this function:

◆ 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 86 of file connection_monitor_core.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ print()

void print ( )

Definition at line 323 of file connection_monitor_core.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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 353 of file connection_monitor_core.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setConnectFileId()

void setConnectFileId ( FILE *  connFileId)

Definition at line 426 of file connection_monitor_core.cpp.

Here is the caller graph for this function:

◆ setUpdateTimeIntervalSec()

void setUpdateTimeIntervalSec ( int  intervalSec)

Definition at line 443 of file connection_monitor_core.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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 461 of file connection_monitor_core.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateTime()

bool updateTime ( int  simTimeMs)
Here is the caller graph for this function:

◆ updateWeight()

void updateWeight ( int  preId,
int  postId,
float  wt 
)
Here is the caller graph for this function:

◆ writeConnectFileSnapshot()

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

Definition at line 529 of file connection_monitor_core.cpp.

Here is the caller graph for this function:

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