reduce step size in PowerLayer gradient checks: fix #1252
authorEvan Shelhamer <shelhamer@imaginarynumber.net>
Fri, 6 Feb 2015 09:37:02 +0000 (01:37 -0800)
committerEvan Shelhamer <shelhamer@imaginarynumber.net>
Fri, 6 Feb 2015 09:37:02 +0000 (01:37 -0800)
The gradient checker fails on certain elements of the PowerLayer checks,
but only 1-3 sometimes fail out of the 120 elements tested. This is not
due to any numerical issue in the PowerLayer, but the distribution of
the random inputs for the checks.

boost 1.56 switched the normal distribution RNG engine from Box-Muller
to Ziggurat.

src/caffe/test/test_power_layer.cpp

index 0d52fa1..76c9e85 100644 (file)
@@ -74,7 +74,7 @@ class PowerLayerTest : public MultiDeviceTest<TypeParam> {
         }
       }
     }
-    GradientChecker<Dtype> checker(1e-2, 1e-2, 1701, 0., 0.01);
+    GradientChecker<Dtype> checker(1e-3, 1e-2, 1701, 0., 0.01);
     checker.CheckGradientEltwise(&layer, this->blob_bottom_vec_,
         this->blob_top_vec_);
   }