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