haojin2 commented on a change in pull request #14673: [BUGFIX] fix ELU function 
will appear nan when calculating the gradient
URL: https://github.com/apache/incubator-mxnet/pull/14673#discussion_r276548948
 
 

 ##########
 File path: python/mxnet/gluon/nn/activations.py
 ##########
 @@ -158,7 +158,7 @@ def __init__(self, alpha=1.0, **kwargs):
         self._alpha = alpha
 
     def hybrid_forward(self, F, x):
-        return F.where(x > 0, x, self._alpha * (F.exp(x) - 1.0))
+         F.LeakyReLU(x, act_type='elu', slope=self._alpha)
 
 Review comment:
   Seems like you have an extra whitespace here, please get rid of that and 
this is good to go.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to