Crate caffe2op_marginrank
source ·Structs
- | MarginRankingCriterionGradient | takes both X1, X2, Y and dY and uses them | to update dX1, and dX2 according to the | chain rule and derivatives of the loss | function. |
- | MarginRankingCriterion takes two | input data X1 (Tensor), | | X2 (Tensor), and label Y (Tensor) to | produce the loss (Tensor) where the | loss function,
loss(X1, X2, Y) = max(0, | -Y * (X1 - X2) + margin)
is applied to | the tensor elementwise. | | If y == 1 then it assumed the first input | should be ranked higher (have a larger | value) than the second input, and vice-versa | for y == -1. |