8 #include "PointLIFProbe.hpp" 9 #include "../layers/HyPerLayer.hpp" 10 #include "../layers/LIF.hpp" 14 #define NUMBER_OF_VALUES 6 // G_E, G_I, G_IB, V, Vth, A 15 #define CONDUCTANCE_PRINT_FORMAT "%6.3f" 19 PointLIFProbe::PointLIFProbe() : PointProbe() {
26 PointLIFProbe::PointLIFProbe(
const char *name, HyPerCol *hc) : PointProbe() {
31 int PointLIFProbe::initialize_base() {
37 int PointLIFProbe::initialize(
const char *name, HyPerCol *hc) {
38 int status = PointProbe::initialize(name, hc);
45 ioParam_writeStep(ioFlag);
49 void PointLIFProbe::ioParam_writeStep(
enum ParamsIOFlag ioFlag) {
50 writeStep = parent->getDeltaTime();
51 parent->parameters()->ioParamValue(
52 ioFlag, getName(),
"writeStep", &writeStep, writeStep,
true );
61 LIF *LIF_layer =
dynamic_cast<LIF *
>(getTargetLayer());
62 assert(LIF_layer != NULL);
63 pvconductance_t
const *G_E =
64 LIF_layer->getConductance(CHANNEL_EXC) + batchLoc * LIF_layer->getNumNeurons();
65 pvconductance_t
const *G_I =
66 LIF_layer->getConductance(CHANNEL_INH) + batchLoc * LIF_layer->getNumNeurons();
67 pvconductance_t
const *G_IB =
68 LIF_layer->getConductance(CHANNEL_INHB) + batchLoc * LIF_layer->getNumNeurons();
69 float const *V = getTargetLayer()->getV();
70 float const *Vth = LIF_layer->getVth();
71 float const *activity = getTargetLayer()->getLayerData();
72 assert(V && activity && G_E && G_I && G_IB && Vth);
78 const PVLayerLoc *loc = getTargetLayer()->getLayerLoc();
80 const int kx0 = loc->kx0;
81 const int ky0 = loc->ky0;
82 const int kb0 = loc->kb0;
83 const int nx = loc->nx;
84 const int ny = loc->ny;
85 const int nf = loc->nf;
86 const int nbatch = loc->nbatch;
87 const int xLocLocal = xLoc - kx0;
88 const int yLocLocal = yLoc - ky0;
89 const int nbatchLocal = batchLoc - kb0;
92 if (xLocLocal >= 0 && xLocLocal < nx && yLocLocal >= 0 && yLocLocal < ny && nbatchLocal >= 0
93 && nbatchLocal < nbatch) {
94 const float *V = getTargetLayer()->getV();
95 const float *activity = getTargetLayer()->getLayerData();
97 const int k = kIndex(xLocLocal, yLocLocal, fLoc, nx, ny, nf);
98 const int kbatch = k + nbatchLocal * getTargetLayer()->getNumNeurons();
99 valuesBuffer[0] = G_E[kbatch];
100 valuesBuffer[1] = G_I[kbatch];
101 valuesBuffer[2] = G_IB[kbatch];
102 valuesBuffer[3] = V[kbatch];
103 valuesBuffer[4] = Vth[kbatch];
105 kIndexExtended(k, nx, ny, nf, loc->halo.lt, loc->halo.rt, loc->halo.dn, loc->halo.up);
106 valuesBuffer[5] = activity[kex + nbatchLocal * getTargetLayer()->getNumExtended()];
108 if (parent->columnId() != 0) {
115 parent->getCommunicator()->communicator());
120 if (parent->columnId() == 0) {
123 int xRank = xLoc / nx;
124 int yRank = yLoc / ny;
126 int srcRank = rankFromRowAndColumn(
129 parent->getCommunicator()->numCommRows(),
130 parent->getCommunicator()->numCommColumns());
140 parent->getCommunicator()->communicator(),
160 if (!mOutputStreams.empty() and timevalue >= writeTime) {
161 writeTime += writeStep;
162 PVLayerLoc const *loc = getTargetLayer()->getLayerLoc();
163 const int k = kIndex(xLoc, yLoc, fLoc, loc->nxGlobal, loc->nyGlobal, loc->nf);
167 "G_E=" CONDUCTANCE_PRINT_FORMAT
" G_I=" CONDUCTANCE_PRINT_FORMAT
168 " G_IB=" CONDUCTANCE_PRINT_FORMAT
" V=" CONDUCTANCE_PRINT_FORMAT
169 " Vth=" CONDUCTANCE_PRINT_FORMAT
" a=%.1f",
virtual void initNumValues() override
virtual int ioParamsFillGroup(enum ParamsIOFlag ioFlag) override
PrintStream & output(int b)
virtual int ioParamsFillGroup(enum ParamsIOFlag ioFlag) override
double * getValuesBuffer()
virtual void calcValues(double timevalue) override
const char * getMessage()
virtual void writeState(double timevalue) override