#include "caffe/vision_layers.hpp"
#include "caffe/util/math_functions.hpp"
-#define CAFFE_MAX_POOLING_THRESHOLD 1e-8f
-
using std::max;
using std::min;
for (int w = wstart; w < wend; ++w) {
bottom_diff[h * WIDTH_ + w] +=
top_diff[ph * POOLED_WIDTH_ + pw] *
- (bottom_data[h * WIDTH_ + w] >=
- top_data[ph * POOLED_WIDTH_ + pw] -
- CAFFE_MAX_POOLING_THRESHOLD);
+ (bottom_data[h * WIDTH_ + w] ==
+ top_data[ph * POOLED_WIDTH_ + pw]);
}
}
}
#include "caffe/vision_layers.hpp"
#include "caffe/util/math_functions.hpp"
-#define CAFFE_MAX_POOLING_THRESHOLD 1e-8f
-
using std::max;
using std::min;
for (int ph = phstart; ph < phend; ++ph) {
for (int pw = pwstart; pw < pwend; ++pw) {
gradient += top_diff[ph * pooled_width + pw] *
- (bottom_datum >= top_data[ph * pooled_width + pw] -
- CAFFE_MAX_POOLING_THRESHOLD);
+ (bottom_datum == top_data[ph * pooled_width + pw]);
}
}
bottom_diff[index] = gradient;