8 #include "LeakyIntegrator.hpp" 13 LeakyIntegrator::LeakyIntegrator(
const char *name, HyPerCol *hc) {
18 LeakyIntegrator::LeakyIntegrator() { initialize_base(); }
20 int LeakyIntegrator::initialize_base() {
22 integrationTime = FLT_MAX;
26 int LeakyIntegrator::initialize(
const char *name, HyPerCol *hc) {
27 int status = ANNLayer::initialize(name, hc);
28 assert(numChannels == 1);
34 ioParam_integrationTime(ioFlag);
38 void LeakyIntegrator::ioParam_integrationTime(
enum ParamsIOFlag ioFlag) {
39 parent->parameters()->ioParamValue(
40 ioFlag, name,
"integrationTime", &integrationTime, integrationTime);
43 Response::Status LeakyIntegrator::updateState(
double timed,
double dt) {
45 float *gSyn = GSyn[0];
47 float decayfactor = std::exp(-(
float)dt / integrationTime);
48 for (
int k = 0; k < getNumNeuronsAllBatches(); k++) {
51 if (numChannels > 1) {
55 int nx = getLayerLoc()->nx;
56 int ny = getLayerLoc()->ny;
57 int nf = getLayerLoc()->nf;
58 int nbatch = getLayerLoc()->nbatch;
60 PVHalo const *halo = &getLayerLoc()->halo;
61 float *A = getActivity();
62 setActivity_PtwiseLinearTransferLayer(
78 return Response::SUCCESS;
81 LeakyIntegrator::~LeakyIntegrator() {}
virtual int ioParamsFillGroup(enum ParamsIOFlag ioFlag) override
virtual int ioParamsFillGroup(enum ParamsIOFlag ioFlag) override