Ejemplo n.º 1
0
int PtwiseProductLayer::doUpdateState(double timef, double dt, const PVLayerLoc * loc, pvdata_t * A, pvdata_t * V, int num_channels, pvdata_t * gSynHead) {
   int nx = loc->nx;
   int ny = loc->ny;
   int nf = loc->nf;
   int num_neurons = nx*ny*nf;
   int nbatch = loc->nbatch;
   updateV_PtwiseProductLayer(nbatch, num_neurons, V, gSynHead);
   setActivity_HyPerLayer(nbatch, num_neurons, A, V, nx, ny, nf, loc->halo.lt, loc->halo.rt, loc->halo.dn, loc->halo.up);
   return PV_SUCCESS;
}
Ejemplo n.º 2
0
int TrainingLayer::updateState(double timed, double dt, const PVLayerLoc * loc, pvdata_t * A, pvdata_t * V, int numTrainingLabels, int * trainingLabels, int traininglabelindex, int strength) {
   int nx = loc->nx;
   int ny = loc->ny;
   int nf = loc->nf;
   int num_neurons = nx*ny*nf;
   int status = updateV_TrainingLayer(num_neurons, V, numTrainingLabels, trainingLabels, curTrainingLabelIndex, strength);
   assert(status == PV_SUCCESS);
   curTrainingLabelIndex++;
   setActivity_HyPerLayer(num_neurons, A, V, nx, ny, nf, loc->halo.lt, loc->halo.rt, loc->halo.dn, loc->halo.up);
   return PV_SUCCESS;
}
Ejemplo n.º 3
0
int KmeansLayer::setActivity()
{
    const PVLayerLoc * loc = getLayerLoc();
    int nx = loc->nx;
    int ny = loc->ny;
    int nf = loc->nf;
    PVHalo const * halo = &loc->halo;
    int num_neurons = nx*ny*nf;
    int nbatch = loc->nbatch;
    int status;

    status = setActivity_HyPerLayer(nbatch, num_neurons, getCLayer()->activity->data, getV(), nx, ny, nf, halo->lt, halo->rt, halo->dn, halo->up);

    return status;
}
int MatchingPursuitResidual::updateState(double timed, double dt) {
   pvdata_t * V = getV();
   if (inputInV) {
      for (int k=0; k<getNumNeuronsAllBatches(); k++) {
         V[k] -= GSyn[1][k];
      }
   }
   else {
      for (int k=0; k<getNumNeuronsAllBatches(); k++) {
         V[k] = GSyn[0][k];
      }
      inputInV = true;
   }
   PVLayerLoc const * loc = getLayerLoc();
   setActivity_HyPerLayer(loc->nbatch, getNumNeurons(), getActivity(), V, loc->nx, loc->ny, loc->nf, loc->halo.lt, loc->halo.rt, loc->halo.dn, loc->halo.up);
   return PV_SUCCESS;
}