From a0335b801f5c8dfa369c348116ba21111c22ce36 Mon Sep 17 00:00:00 2001 From: Valentin Churavy Date: Tue, 8 Dec 2015 00:59:01 +0900 Subject: [PATCH] ELU: change greater than equal to strict greater. Following the discussion in [1] and the original implementation in [2]. In the original implementation > 0 was used not as reported in the paper. [1] https://github.com/BVLC/caffe/pull/3388 [2] https://github.com/untom/binet/commit/2c8a6bd61ed59fd65453ae107a6a7c7c9e65f5dc --- src/operator/mshadow_op.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/operator/mshadow_op.h b/src/operator/mshadow_op.h index ec5493728f26..10ea34c6a408 100644 --- a/src/operator/mshadow_op.h +++ b/src/operator/mshadow_op.h @@ -71,13 +71,13 @@ struct xelu_grad { /*! \brief Exponential Linear Unit */ struct elu { MSHADOW_XINLINE static real_t Map(real_t x, real_t a) { - return x >= 0.0f ? x : a * (expf(x) - 1.0f); + return x > 0.0f ? x : a * (expf(x) - 1.0f); } }; struct elu_grad { MSHADOW_XINLINE static real_t Map(real_t x, real_t a) { - return x >= 0.0f ? 1.0f : a * expf(x); + return x > 0.0f ? 1.0f : a * expf(x); } };