Esempio n. 1
0
int PoolingConn::constructWeights() {
    int sx = nfp;
    int sy = sx * nxp;
    int sp = sy * nyp;
    int nPatches = getNumDataPatches();
    int status = PV_SUCCESS;

    assert(!parent->parameters()->presentAndNotBeenRead(name, "shrinkPatches"));
    // createArbors() uses the value of shrinkPatches.  It should have already been read in ioParamsFillGroup.
    //allocate the arbor arrays:
    createArbors();

    setPatchStrides();

    for (int arborId=0; arborId<numAxonalArborLists; arborId++) {
        PVPatch *** wPatches = get_wPatches();
        status = createWeights(wPatches, arborId);
        assert(wPatches[arborId] != NULL);
        if (shrinkPatches_flag || arborId == 0) {
            status |= adjustAxonalArbors(arborId);
        }
    }  // arborId

    //call to initializeWeights moved to BaseConnection::initializeState()
    status |= initPlasticityPatches();
    assert(status == 0);
    if (shrinkPatches_flag) {
        for (int arborId=0; arborId<numAxonalArborLists; arborId++) {
            shrinkPatches(arborId);
        }
    }

    return status;

}
Esempio n. 2
0
void SolidSDF::createWeights(FaceArray2Xf & uw, FaceArray2Yf & vw)
{
    createWeights(_phi, uw, vw);
}