17 #include "roi_pool_f_op.h" 21 REGISTER_CPU_OPERATOR(RoIPoolF, RoIPoolFOp<float, CPUContext>);
22 REGISTER_CPU_OPERATOR(RoIPoolFGradient, RoIPoolFGradientOp<float, CPUContext>);
24 OPERATOR_SCHEMA(RoIPoolF)
28 Region of Interest (RoI) pooling operation as used in Fast R-CNN. 32 "(float) default 1.0; Spatial scale of the input feature map X " 33 "relative to the input image. E.g., 0.0625 if X has a stride of 16 " 34 "w.r.t. the input image.")
37 "(int) default 1; Pooled output Y's height.")
40 "(int) default 1; Pooled output Y's width.")
44 "4D feature map input of shape (N, C, H, W).")
48 "2D input of shape (R, 5) specifying R RoIs with five columns " 49 "representing: batch index in [0, N - 1], x1, y1, x2, y2. The RoI " 50 "coordinates are in the coordinate system of the input image.")
54 "4D output of shape (R, C, pooled_h, pooled_w). The r-th batch element " 55 "is a pooled feature map cooresponding to the r-th RoI.")
59 "4D output of shape (R, C, pooled_h, pooled_w). Same as Y, except it " 60 "records the argmax indices rather than the max pooled values.");
62 OPERATOR_SCHEMA(RoIPoolFGradient)
80 "Gradient of forward output 0 (Y)")
84 "Gradient of forward input 0 (X)");
86 class GetRoIPoolFGradient :
public GradientMakerBase {
87 using GradientMakerBase::GradientMakerBase;
88 vector<OperatorDef> GetGradientDefs()
override {
89 return SingleGradientDef(
92 vector<string>{I(0), I(1), O(1), GO(0)},
93 vector<string>{GI(0)});
97 REGISTER_GRADIENT(RoIPoolF, GetRoIPoolFGradient);
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...