You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/06/05 03:25:22 UTC

[GitHub] szha commented on a change in pull request #10957: Make inner transform activation configurable for LSTMCell

szha commented on a change in pull request #10957: Make inner transform activation configurable for LSTMCell
URL: https://github.com/apache/incubator-mxnet/pull/10957#discussion_r192936793
 
 

 ##########
 File path: python/mxnet/gluon/rnn/rnn_cell.py
 ##########
 @@ -251,12 +252,17 @@ def unroll(self, length, inputs, begin_state=None, layout='NTC', merge_outputs=N
     #pylint: disable=no-self-use
     def _get_activation(self, F, inputs, activation, **kwargs):
         """Get activation function. Convert if is string"""
-        if isinstance(activation, string_types):
+        if activation == 'tanh':
+            return F.tanh(inputs, **kwargs)
+        elif activation == 'sigmoid':
+            return F.sigmoid(inputs, **kwargs)
+        elif activation == 'relu':
+            return F.relu(inputs, **kwargs)
 
 Review comment:
   add softsign

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


With regards,
Apache Git Services