CARLsim
4.1.0
CARLsim: a GPU-accelerated SNN simulator
|
Go to the documentation of this file.
48 #ifndef _CONN_MON_CORE_H_
49 #define _CONN_MON_CORE_H_
141 void printSparse(
int neurPostId=
ALL,
int maxConn=100,
int connPerLine=4,
bool storeNewSnapshot=
true);
174 bool needToWriteSnapshot();
176 void updateStoredWeights();
179 void writeConnectFileHeader();
195 std::vector< std::vector<float> > wtMat_;
196 std::vector< std::vector<float> > wtMatLast_;
198 long long wtTimeLast_;
199 long long wtTimeWrite_;
202 bool needToWriteFileHeader_;
205 int connFileSignature_;
206 float connFileVersion_;
207 int connFileTimeIntervalSec_;
bool updateTime(int simTimeMs)
updates timestamp of the snapshots, returns true if update was needed
void setUpdateTimeIntervalSec(int intervalSec)
sets time update interval (seconds) for periodically storing weights to file
int getNumWeightsInRange(double minVal, double maxVal)
returns number of weights with values in range e[minVal,maxVal] (inclusive)
std::vector< std::vector< float > > calcWeightChanges()
calculates weight changes since last snapshot and reports them in 2D weight change matrix
float getMinWeight(bool getCurrent=false)
returns min weight in the connection (getCurrent=false: RangeWeight.min, true: current smallest)
long int getTimeMsCurrentSnapshot()
returns the timestamp of the current snapshot (not necessarily CARLsim::getSimTime)
void print()
prints current weight state as 2D matrix (non-existent synapses: NAN, existent but zero weigth: 0....
ConnectionMonitorCore(SNN *snn, int monitorId, short int connId, int grpIdPre, int grpIdPost)
constructor, created by CARLsim::setConnectionMonitor
void printSparse(int neurPostId=ALL, int maxConn=100, int connPerLine=4, bool storeNewSnapshot=true)
short int getConnectId()
returns connection ID
int getNumWeightsWithValue(double value)
returns number of weights that have a certain value
void updateWeight(int preId, int postId, float wt)
updates an entry in the current weight matrix (called by CARLsim::updateConnectionMonitor)
float getMaxWeight(bool getCurrent=false)
returns max weight in the connection (getCurrent=false: RangeWeight.max, true: current largest)
int getMonitorId()
returns ConnectionMonitor ID
int getNumNeuronsPost()
returns number of neurons in post-synaptic group
void clear()
deletes data from the 2D weight matrix
#define ALL
CARLsim common definitions.
FILE * getConnectFileId()
returns pointer to connection file
int getNumWeightsChanged(double minAbsChanged=1e-5)
returns number of weights with >=minAbsChanged weight change since last snapshot
~ConnectionMonitorCore()
destructor, cleans up all the memory upon object deletion
int getFanOut(int neurPreId)
returns number of outgoing synapses of pre-synaptic neuron
long int getTimeMsLastSnapshot()
returns the timestamp of the last snapshot
int getNumSynapses()
returns number of synapses that exist in the connection
void setConnectFileId(FILE *connFileId)
sets pointer to connection file
int getNumNeuronsPre()
returns number of neurons in pre-synaptic group
double getTotalAbsWeightChange()
returns absolute sum of all weight changes since last snapshot
void writeConnectFileSnapshot(int simTimeMs, std::vector< std::vector< float > > wts)
writes each snapshot to connect file
Contains all of CARLsim's core functionality.
long int getTimeMsSinceLastSnapshot()
returns the time passed between current and last snapshot
int getUpdateTimeIntervalSec()
int getFanIn(int neurPostId)
returns number of incoming synapses to post-synaptic neuron
std::vector< std::vector< float > > takeSnapshot()