You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2020/12/24 19:49:47 UTC

[GitHub] [tvm] junrushao1994 commented on a change in pull request #7163: [Relay] Add fast_softmax

junrushao1994 commented on a change in pull request #7163:
URL: https://github.com/apache/tvm/pull/7163#discussion_r548734299



##########
File path: python/tvm/relay/op/nn/nn.py
##########
@@ -698,6 +698,29 @@ def softmax(data, axis=-1):
     return _make.softmax(data, axis)
 
 
+def fast_softmax(data, axis=-1):
+    r"""Computes softmax.
+    Use approximation to compute exponent for faster speed.
+
+    .. math:: \text{softmax}(x)_i = \frac{exp(x_i)}{\sum_j exp(x_j)}

Review comment:
       would you like to update the formula to reflect we are using alternative ways to compute the softmax?




----------------------------------------------------------------
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:
users@infra.apache.org