1 #include "DropoutLayer.hpp" 5 DropoutLayer::DropoutLayer(
const char *name, HyPerCol *hc) { initialize(name, hc); }
7 DropoutLayer::~DropoutLayer() {}
10 ioParam_probability(ioFlag);
14 void DropoutLayer::ioParam_probability(
enum ParamsIOFlag ioFlag) {
15 parent->parameters()->ioParamValue(
16 ioFlag, name,
"probability", &mProbability, mProbability,
true);
17 if (mProbability > 99) {
18 WarnLog() << getName() <<
": probability was set to >= 100%. Changing to 99%.\n";
23 Response::Status DropoutLayer::updateState(
double timestamp,
double dt) {
24 ANNLayer::updateState(timestamp, dt);
25 float *A = getCLayer()->activity->data;
26 int total = getNumExtendedAllBatches();
28 #ifdef PV_USE_OPENMP_THREADS 29 #pragma omp parallel for 31 for (
int i = 0; i < total; ++i) {
32 if (rand() % 100 < mProbability) {
37 return Response::SUCCESS;
virtual int ioParamsFillGroup(enum ParamsIOFlag ioFlag) override
virtual int ioParamsFillGroup(enum ParamsIOFlag ioFlag) override