From 73ab2d4678418d42dd5a03d5f8531b49eab2e7ce Mon Sep 17 00:00:00 2001 From: Luo Tao Date: Mon, 21 Aug 2017 17:57:06 +0800 Subject: [PATCH] fix backward error of huber_regression_cost --- paddle/gserver/layers/CostLayer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paddle/gserver/layers/CostLayer.cpp b/paddle/gserver/layers/CostLayer.cpp index 91a742422..7f648070f 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); } -- GitLab