CARLsim
6.1.0
CARLsim: a GPU-accelerated SNN simulator
|
#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... | |
Definition at line 70 of file connection_monitor_core.h.
ConnectionMonitorCore | ( | SNN * | snn, |
int | monitorId, | ||
short int | connId, | ||
int | grpIdPre, | ||
int | grpIdPost | ||
) |
Definition at line 63 of file connection_monitor_core.cpp.
Definition at line 122 of file connection_monitor_core.cpp.
std::vector< std::vector< float > > calcWeightChanges | ( | ) |
Definition at line 152 of file connection_monitor_core.cpp.
void clear | ( | ) |
Definition at line 168 of file connection_monitor_core.cpp.
|
inline |
|
inline |
Definition at line 91 of file connection_monitor_core.h.
int getFanIn | ( | int | neurPostId | ) |
Definition at line 178 of file connection_monitor_core.cpp.
int getFanOut | ( | int | neurPreId | ) |
Definition at line 190 of file connection_monitor_core.cpp.
float getMaxWeight | ( | bool | getCurrent = false | ) |
Definition at line 201 of file connection_monitor_core.cpp.
float getMinWeight | ( | bool | getCurrent = false | ) |
Definition at line 226 of file connection_monitor_core.cpp.
|
inline |
Definition at line 110 of file connection_monitor_core.h.
|
inline |
Definition at line 116 of file connection_monitor_core.h.
|
inline |
Definition at line 113 of file connection_monitor_core.h.
|
inline |
Definition at line 119 of file connection_monitor_core.h.
int getNumWeightsChanged | ( | double | minAbsChanged = 1e-5 | ) |
Definition at line 252 of file connection_monitor_core.cpp.
int getNumWeightsInRange | ( | double | minVal, |
double | maxVal | ||
) |
Definition at line 272 of file connection_monitor_core.cpp.
int getNumWeightsWithValue | ( | double | value | ) |
Definition at line 299 of file connection_monitor_core.cpp.
std::vector< std::vector< float > > getPrevWeights | ( | ) |
Definition at line 147 of file connection_monitor_core.cpp.
|
inline |
Definition at line 131 of file connection_monitor_core.h.
|
inline |
Definition at line 134 of file connection_monitor_core.h.
|
inline |
Definition at line 137 of file connection_monitor_core.h.
double getTotalAbsWeightChange | ( | ) |
Definition at line 309 of file connection_monitor_core.cpp.
|
inline |
Definition at line 139 of file connection_monitor_core.h.
std::vector< std::vector< float > > getWeights | ( | ) |
Definition at line 142 of file connection_monitor_core.cpp.
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.
void print | ( | ) |
Definition at line 323 of file connection_monitor_core.cpp.
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.
void setConnectFileId | ( | FILE * | connFileId | ) |
Definition at line 426 of file connection_monitor_core.cpp.
void setUpdateTimeIntervalSec | ( | int | intervalSec | ) |
Definition at line 443 of file connection_monitor_core.cpp.
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.
bool updateTime | ( | int | simTimeMs | ) |
void updateWeight | ( | int | preId, |
int | postId, | ||
float | wt | ||
) |
void writeConnectFileSnapshot | ( | int | simTimeMs, |
std::vector< std::vector< float > > | wts | ||
) |
Definition at line 529 of file connection_monitor_core.cpp.