17 #include "ps_roi_pool_op.h" 21 REGISTER_CPU_OPERATOR(PSRoIPool, PSRoIPoolOp<float, CPUContext>);
22 REGISTER_CPU_OPERATOR(
24 PSRoIPoolGradientOp<float, CPUContext>);
26 OPERATOR_SCHEMA(PSRoIPool)
30 Position Sensitive Region of Interest Pooling as used in R-FCN. 34 "(float) default 1.0; Spatial scale of the input feature map X " 35 "relative to the input image. E.g., 0.0625 if X has a stride of 16 " 36 "w.r.t. the input image.")
39 "(int) default 1; pooled_h = pooled_w = group_size where pooled_{h,w} " 40 "is the pooled output Y's height and width, respectively.")
43 "(int) default 1; number of channels in the pooled output, which might " 44 "be the number of classes is used for classification or 4 if used for " 45 "class agnostic bounding box regression.")
49 "4D position sensitive feature map input of shape (N, C, H, W), where " 50 "C = group_size**2 * output_dim.")
54 "2D input of shape (R, 5) specifying R RoIs with five columns " 55 "representing: batch index in [0, N - 1], x1, y1, x2, y2. The RoI " 56 "coordinates are in the coordinate system of the input image.")
60 "4D output of shape (R, output_dim, pooled_h, pooled_w). The r-th " 61 "batch element is a pooled feature map cooresponding to the r-th RoI.")
65 "4D output of shape (R, output_dim, pooled_h, pooled_w). Same as Y, " 66 "except it records the argmax indices rather than the max pooled " 69 OPERATOR_SCHEMA(PSRoIPoolGradient)
87 "Gradient of forward output 0 (Y)")
91 "Gradient of forward input 0 (X)");
93 class GetPSRoIPoolGradient :
public GradientMakerBase {
94 using GradientMakerBase::GradientMakerBase;
95 vector<OperatorDef> GetGradientDefs()
override {
96 return SingleGradientDef(
99 vector<string>{I(0), I(1), O(1), GO(0)},
100 vector<string>{GI(0)});
104 REGISTER_GRADIENT(PSRoIPool, GetPSRoIPoolGradient);
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...