Skip to content

Commit a0335b8

Browse files
committed
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] BVLC/caffe#3388 [2] untom/binet@2c8a6bd
1 parent e8cb37e commit a0335b8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/operator/mshadow_op.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,13 @@ struct xelu_grad {
7171
/*! \brief Exponential Linear Unit */
7272
struct elu {
7373
MSHADOW_XINLINE static real_t Map(real_t x, real_t a) {
74-
return x >= 0.0f ? x : a * (expf(x) - 1.0f);
74+
return x > 0.0f ? x : a * (expf(x) - 1.0f);
7575
}
7676
};
7777

7878
struct elu_grad {
7979
MSHADOW_XINLINE static real_t Map(real_t x, real_t a) {
80-
return x >= 0.0f ? 1.0f : a * expf(x);
80+
return x > 0.0f ? 1.0f : a * expf(x);
8181
}
8282
};
8383

0 commit comments

Comments
 (0)