diff --git a/paddle/gserver/layers/CostLayer.cpp b/paddle/gserver/layers/CostLayer.cpp index 91a742422e2f2efc1a0f4b6ec55963a3e9bdc254..7f648070f27a2f155beb06c76971dd690fca7e9c 100644 --- a/paddle/gserver/layers/CostLayer.cpp +++ b/paddle/gserver/layers/CostLayer.cpp @@ -644,7 +644,7 @@ void HuberRegressionLoss::backwardImp(Matrix& output, if (std::abs(a) <= delta_) grad[i] += -a; else - grad[i] += a > 0 ? delta_ : -delta_; + grad[i] += a > 0 ? -delta_ : delta_; } if (useGpu_) outputG.copyFrom(grad, numSamples); }