55 void SNN::printStatusConnectionMonitor(
int connId) {
56 for (
int monId=0; monId<numConnectionMonitor; monId++) {
65 void SNN::printStatusSpikeMonitor(
int gGrpId) {
67 for (
int g = 0; g < numGroups; g++) {
68 printStatusSpikeMonitor(g);
71 int netId = groupConfigMDMap[gGrpId].netId;
72 int lGrpId = groupConfigMDMap[gGrpId].lGrpId;
73 int monitorId = groupConfigMDMap[gGrpId].spikeMonitorId;
75 if (monitorId == -1)
return;
78 fetchNeuronSpikeCount(gGrpId);
84 for (
int gNId = groupConfigMDMap[gGrpId].gStartN; gNId <= groupConfigMDMap[gGrpId].gEndN; gNId++)
85 grpSpk += managerRuntimeData.
nSpikeCnt[gNId];
88 int runDurationMs = simTime - simTimeLastRunSummary;
90 if (simTime <= simTimeLastRunSummary) {
91 KERNEL_INFO(
"(t=%.3fs) SpikeMonitor for group %s(%d) has %d spikes in %dms (%.2f +/- %.2f Hz)",
92 (
float)(simTime / 1000.0f),
93 groupConfigMap[gGrpId].grpName.c_str(),
101 float meanRate = grpSpk * 1000.0f / runDurationMs / groupConfigMap[gGrpId].numN;
103 if (groupConfigMap[gGrpId].numN > 1) {
104 for (
int gNId = groupConfigMDMap[gGrpId].gStartN; gNId <= groupConfigMDMap[gGrpId].gEndN; gNId++) {
105 float neurRate = managerRuntimeData.
nSpikeCnt[gNId] * 1000.0f / runDurationMs;
106 std += (neurRate - meanRate) * (neurRate - meanRate);
108 std = sqrt(std / (groupConfigs[netId][lGrpId].numN - 1.0));
111 KERNEL_INFO(
"(t=%.3fs) SpikeMonitor for group %s(%d) has %d spikes in %ums (%.2f +/- %.2f Hz)",
113 groupConfigMap[gGrpId].grpName.c_str(),
123 void SNN::printStatusGroupMonitor(
int gGrpId) {
125 for (
int g = 0; g < numGroups; g++) {
126 printStatusGroupMonitor(g);
129 int netId = groupConfigMDMap[gGrpId].netId;
130 int lGrpId = groupConfigMDMap[gGrpId].lGrpId;
131 int monitorId = groupConfigMDMap[gGrpId].groupMonitorId;
133 if (monitorId == -1)
return;
135 std::vector<int> peakTimeVector = groupMonCoreList[monitorId]->
getPeakTimeVector();
136 int numPeaks = peakTimeVector.size();
139 int runDurationMs = simTime - simTimeLastRunSummary;
141 if (simTime <= simTimeLastRunSummary) {
142 KERNEL_INFO(
"(t=%.3fs) GroupMonitor for group %s(%d) has %d peak(s) in %dms",
144 groupConfigMap[gGrpId].grpName.c_str(),
150 KERNEL_INFO(
"(t=%.3fs) GroupMonitor for group %s(%d) has %d peak(s) in %ums",
152 groupConfigMap[gGrpId].grpName.c_str(),
161 void SNN::printConnectionInfo(
short int connId) {
164 KERNEL_INFO(
"Connection ID %d: %s(%d) => %s(%d)", connId, groupConfigMap[connConfig.
grpSrc].grpName.c_str(),
178 KERNEL_INFO(
" - Avg numPreSynapses = %8.2f", avgPreM );
179 KERNEL_INFO(
" - Avg numPostSynapses = %8.2f", avgPostM );
185 KERNEL_INFO(" - ALPHA_PLUS_EXC = %8.5f", connConfig.stdpConfig.ALPHA_PLUS_EXC);
186 KERNEL_INFO(" - ALPHA_MINUS_EXC = %8.5f", connConfig.stdpConfig.ALPHA_MINUS_EXC);
187 KERNEL_INFO(" - TAU_PLUS_INV_EXC = %8.5f", connConfig.stdpConfig.TAU_PLUS_INV_EXC);
188 KERNEL_INFO(" - TAU_MINUS_INV_EXC = %8.5f", connConfig.stdpConfig.TAU_MINUS_INV_EXC);
189 KERNEL_INFO(" - BETA_LTP = %8.5f", connConfig.stdpConfig.BETA_LTP);
190 KERNEL_INFO(" - BETA_LTD = %8.5f", connConfig.stdpConfig.BETA_LTD);
191 KERNEL_INFO(" - LAMBDA = %8.5f", connConfig.stdpConfig.LAMBDA);
192 KERNEL_INFO(" - DELTA = %8.5f", connConfig.stdpConfig.DELTA);
197 void SNN::printConnectionInfo(
int netId, std::list<
ConnectConfig>::iterator connIt) {
199 KERNEL_INFO(
" |-+ %s Connection Id %d: %s(%d) => %s(%d)", netId == groupConfigMDMap[connIt->grpDest].netId ?
"Local" :
"External", connIt->connId,
200 groupConfigMap[connIt->grpSrc].grpName.c_str(), connIt->grpSrc,
201 groupConfigMap[connIt->grpDest].grpName.c_str(), connIt->grpDest);
204 KERNEL_INFO(
" |- Max weight = %8.5f", fabs(connIt->maxWt));
205 KERNEL_INFO(
" |- Initial weight = %8.5f", fabs(connIt->initWt));
206 KERNEL_INFO(
" |- Min delay = %8d", connIt->minDelay);
207 KERNEL_INFO(
" |- Max delay = %8d", connIt->maxDelay);
208 KERNEL_INFO(
" |- Radius X = %8.2f", connIt->connRadius.radX);
209 KERNEL_INFO(
" |- Radius Y = %8.2f", connIt->connRadius.radY);
210 KERNEL_INFO(
" |- Radius Z = %8.2f", connIt->connRadius.radZ);
211 KERNEL_INFO(
" |- Num of synapses = %d", connIt->numberOfConnections);
212 float avgPostM = ((float)connIt->numberOfConnections)/groupConfigMap[connIt->grpSrc].numN;
213 float avgPreM = ((float)connIt->numberOfConnections)/groupConfigMap[connIt->grpDest].numN;
214 KERNEL_INFO(
" |- Avg numPreSynapses = %8.2f", avgPreM );
215 KERNEL_INFO(
" |- Avg numPostSynapses = %8.2f", avgPostM );
222 KERNEL_INFO(" |- ALPHA_PLUS_EXC = %8.5f", connConfig.stdpConfig.ALPHA_PLUS_EXC);
223 KERNEL_INFO(" |- ALPHA_MINUS_EXC = %8.5f", connConfig.stdpConfig.ALPHA_MINUS_EXC);
224 KERNEL_INFO(" |- TAU_PLUS_INV_EXC = %8.5f", connConfig.stdpConfig.TAU_PLUS_INV_EXC);
225 KERNEL_INFO(" |- TAU_MINUS_INV_EXC = %8.5f", connConfig.stdpConfig.TAU_MINUS_INV_EXC);
226 KERNEL_INFO(" |- BETA_LTP = %8.5f", connConfig.stdpConfig.BETA_LTP);
227 KERNEL_INFO(" |- BETA_LTD = %8.5f", connConfig.stdpConfig.BETA_LTD);
228 KERNEL_INFO(" |- LAMBDA = %8.5f", connConfig.stdpConfig.LAMBDA);
229 KERNEL_INFO(" |- DELTA = %8.5f", connConfig.stdpConfig.DELTA);
230 #ifdef LN_I_CALC_TYPES 239 void SNN::printGroupInfo(
int gGrpId) {
240 KERNEL_INFO(
"Group %s(%d): ", groupConfigMap[gGrpId].grpName.c_str(), gGrpId);
252 KERNEL_INFO(
" - Size = %8d", groupConfigMap[gGrpId].numN);
253 KERNEL_INFO(
" - Start Id = %8d", groupConfigMDMap[gGrpId].gStartN);
254 KERNEL_INFO(
" - End Id = %8d", groupConfigMDMap[gGrpId].gEndN);
255 KERNEL_INFO(
" - numPostSynapses = %8d", groupConfigMDMap[gGrpId].numPostSynapses);
256 KERNEL_INFO(
" - numPreSynapses = %8d", groupConfigMDMap[gGrpId].numPreSynapses);
259 KERNEL_INFO(
" - Avg post connections = %8.5f", ((
float)groupConfigMDMap[gGrpId].numPostSynapses)/groupConfigMap[gGrpId].numN);
260 KERNEL_INFO(
" - Avg pre connections = %8.5f", ((
float)groupConfigMDMap[gGrpId].numPreSynapses )/groupConfigMap[gGrpId].numN);
263 if(groupConfigMap[gGrpId].type & POISSON_NEURON) {
264 KERNEL_INFO(
" - Refractory period = %8.5f", groupConfigMDMap[gGrpId].refractPeriod);
267 if (groupConfigMap[gGrpId].stpConfig.WithSTP) {
268 #ifdef LN_I_CALC_TYPES 269 auto &stp = groupConfigMap[gGrpId].stpConfig;
270 auto &nm4 = groupConfigMap[gGrpId].nm4StpConfig;
271 KERNEL_INFO(
" - STP%s:", nm4.WithNM4STP?
"(modulated)":
"");
275 KERNEL_INFO(
" (%1.1f% 2.1f% 2.1f% 2.1f |% 2.1f || %1.1f)",
276 nm4.w_STP_U[0], nm4.w_STP_U[1], nm4.w_STP_U[2], nm4.w_STP_U[3],
277 nm4.w_STP_U[4], nm4.w_STP_U[5]);
278 KERNEL_INFO(
" - STP_tau_u = %8d", (
int)(1.0f / stp.STP_tau_u_inv));
280 KERNEL_INFO(
" (%1.1f %1.1f %1.1f %1.1f | %1.1f || %1.1f)",
281 nm4.w_STP_tau_u[0], nm4.w_STP_tau_u[1], nm4.w_STP_tau_u[2], nm4.w_STP_tau_u[3],
282 nm4.w_STP_tau_u[4], nm4.w_STP_tau_u[5]);
283 KERNEL_INFO(
" - STP_tau_x = %8d", (
int)(1.0f / stp.STP_tau_x_inv));
285 KERNEL_INFO(
" (%1.1f %1.1f %1.1f %1.1f | %1.1f || %1.1f)",
286 nm4.w_STP_tau_x[0], nm4.w_STP_tau_x[1], nm4.w_STP_tau_x[2], nm4.w_STP_tau_x[3],
287 nm4.w_STP_tau_x[4], nm4.w_STP_tau_x[5]);
290 KERNEL_INFO(
" - STP_A = %8.5f", groupConfigMap[gGrpId].stpConfig.STP_A);
291 KERNEL_INFO(
" - STP_U = %8.5f", groupConfigMap[gGrpId].stpConfig.STP_U);
292 KERNEL_INFO(
" - STP_tau_u = %8d", (
int) (1.0f/groupConfigMap[gGrpId].stpConfig.STP_tau_u_inv));
293 KERNEL_INFO(
" - STP_tau_x = %8d", (
int) (1.0f/groupConfigMap[gGrpId].stpConfig.STP_tau_x_inv));
314 void SNN::printGroupInfo(
int netId, std::list<GroupConfigMD>::iterator grpIt) {
315 int gGrpId = grpIt->gGrpId;
316 KERNEL_INFO(
" |-+ %s Group %s(G:%d,L:%d): ", netId == grpIt->netId ?
"Local" :
"External", groupConfigMap[grpIt->gGrpId].grpName.c_str(), grpIt->gGrpId, grpIt->lGrpId);
328 KERNEL_INFO(
" |- Num of Neurons = %8d", groupConfigMap[grpIt->gGrpId].numN);
329 KERNEL_INFO(
" |- Start Id = (G:%d,L:%d)", grpIt->gStartN, grpIt->lStartN);
330 KERNEL_INFO(
" |- End Id = (G:%d,L:%d)", grpIt->gEndN, grpIt->lEndN);
331 KERNEL_INFO(
" |- numPostSynapses = %8d", grpIt->numPostSynapses);
332 KERNEL_INFO(
" |- numPreSynapses = %8d", grpIt->numPreSynapses);
335 KERNEL_INFO(
" |- Avg post connections = %8.5f", ((
float)grpIt->numPostSynapses) / groupConfigMap[gGrpId].numN);
336 KERNEL_INFO(
" |- Avg pre connections = %8.5f", ((
float)grpIt->numPreSynapses) / groupConfigMap[gGrpId].numN);
339 if (groupConfigMap[gGrpId].type & POISSON_NEURON) {
340 KERNEL_INFO(
" |- Refractory period = %8.5f", grpIt->refractPeriod);
343 if (groupConfigMap[gGrpId].stpConfig.WithSTP) {
344 #ifdef LN_I_CALC_TYPES 345 auto& stp = groupConfigMap[gGrpId].stpConfig;
346 auto& nm4 = groupConfigMap[gGrpId].nm4StpConfig;
347 KERNEL_INFO(
" |-+ STP%s:", nm4.WithNM4STP ?
"(modulated)" :
"");
348 KERNEL_INFO(
" |- STP_A = %8.5f", groupConfigMap[gGrpId].stpConfig.STP_A);
349 KERNEL_INFO(
" |- STP_U = %8.5f", groupConfigMap[gGrpId].stpConfig.STP_U);
351 KERNEL_INFO(
" | (%1.1f% 2.1f% 2.1f% 2.1f |% 2.1f ) % 2.5f",
352 nm4.w_STP_U[0], nm4.w_STP_U[1], nm4.w_STP_U[2], nm4.w_STP_U[3],
353 nm4.w_STP_U[4], nm4.w_STP_U[5]);
354 KERNEL_INFO(
" |- STP_tau_u = %8d", (
int)(1.0f / groupConfigMap[gGrpId].stpConfig.STP_tau_u_inv));
356 KERNEL_INFO(
" | (%1.1f %1.1f %1.1f %1.1f | %1.1f ) % 8.0f",
357 nm4.w_STP_tau_u[0], nm4.w_STP_tau_u[1], nm4.w_STP_tau_u[2], nm4.w_STP_tau_u[3],
358 nm4.w_STP_tau_u[4], nm4.w_STP_tau_u[5]);
359 KERNEL_INFO(
" |- STP_tau_x = %8d", (
int)(1.0f / groupConfigMap[gGrpId].stpConfig.STP_tau_x_inv));
361 KERNEL_INFO(
" | (%1.1f %1.1f %1.1f %1.1f | %1.1f ) % 8.0f",
362 nm4.w_STP_tau_x[0], nm4.w_STP_tau_x[1], nm4.w_STP_tau_x[2], nm4.w_STP_tau_x[3],
363 nm4.w_STP_tau_x[4], nm4.w_STP_tau_x[5]);
366 KERNEL_INFO(
" |- STP_A = %8.5f", groupConfigMap[gGrpId].stpConfig.STP_A);
367 KERNEL_INFO(
" |- STP_U = %8.5f", groupConfigMap[gGrpId].stpConfig.STP_U);
368 KERNEL_INFO(
" |- STP_tau_u = %8d", (
int)(1.0f / groupConfigMap[gGrpId].stpConfig.STP_tau_u_inv));
369 KERNEL_INFO(
" |- STP_tau_x = %8d", (
int)(1.0f / groupConfigMap[gGrpId].stpConfig.STP_tau_x_inv));
390 void SNN::printSikeRoutingInfo() {
391 if (!spikeRoutingTable.empty()) {
392 KERNEL_INFO(
"***************** Spike Routing Table *************************");
393 for (std::list<RoutingTableEntry>::iterator rteItr = spikeRoutingTable.begin(); rteItr != spikeRoutingTable.end(); rteItr++)
394 KERNEL_INFO(
" |-Source net:[%d] -> Destination net[%d]", rteItr->srcNetId, rteItr->destNetId);
bool isPoissonGroup(int gGrpId)
#define ALL
CARLsim common definitions.
int * nSpikeCnt
homeostatic plasticity variables
bool isExcitatoryGroup(int gGrpId)
The configuration of a connection.
short int getConnectId(int grpIdPre, int grpIdPost)
find connection ID based on pre-post group pair, O(N)
#define KERNEL_INFO(formatc,...)
#define GET_FIXED_PLASTIC(a)
static const char * stdpType_string[]
void printSparse(int neurPostId=ALL, int maxConn=100, int connPerLine=4, bool storeNewSnapshot=true)
Contains all of CARLsim's core functionality.
std::vector< int > getPeakTimeVector()
get the timestamps for peak values
bool isInhibitoryGroup(int gGrpId)
bool isDopaminergicGroup(int gGrpId)