17 #include "select_smooth_l1_loss_op.h" 21 REGISTER_CPU_OPERATOR(
23 SelectSmoothL1LossOp<float, CPUContext>);
24 REGISTER_CPU_OPERATOR(
25 SelectSmoothL1LossGradient,
26 SelectSmoothL1LossGradientOp<float, CPUContext>);
28 OPERATOR_SCHEMA(SelectSmoothL1Loss)
32 RetinaNet specific op for computing Smooth L1 Loss at select locations in a 4D 33 tensor that encodes bounding box regression predictions. 37 "(float) default 1.0; L2 to L1 transition point.")
40 "(float) default 1.0; multiply the loss by this scale factor.")
44 "4D tensor of bounding box regression predictions with shape " 45 "(N, 4 * num_bbox_classes * num_anchors, H, W).")
49 "2D tensor of labels shape (M, 4) for 4 contiguous channels starting " 50 "at each of the M locations selected by the locations input.")
54 "2D tensor of shape (M, 4) that identifies M 'select' locations " 55 "encoded by the four colums: (n, c, y, x). The loss is computed on the " 56 "four contiguous channel locations [c, c + 3] (inclusive).")
60 "Scalar; the loss is divided by max(1, normalizer).")
66 OPERATOR_SCHEMA(SelectSmoothL1LossGradient)
72 "See SelectSmoothL1Loss.")
76 "See SelectSmoothL1Loss.")
80 "See SelectSmoothL1Loss.")
84 "See SelectSmoothL1Loss.")
88 "Gradient of forward output 0 (loss).")
92 "Gradient of forward input 0 (Y_hat).");
95 using GradientMakerBase::GradientMakerBase;
96 vector<OperatorDef> GetGradientDefs()
override {
98 "SelectSmoothL1LossGradient",
100 vector<string>{I(0), I(1), I(2), I(3), GO(0)},
101 vector<string>{GI(0)});
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...
static vector< OperatorDef > SingleGradientDef(const Args &...args)
a helper function to allow one to create one single operator def, which is usually the case for many ...