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/08/23 17:26:19 UTC

[GitHub] anirudhacharya commented on a change in pull request #12306: SoftMin Operator

anirudhacharya commented on a change in pull request #12306: SoftMin Operator
URL: https://github.com/apache/incubator-mxnet/pull/12306#discussion_r212373939
 
 

 ##########
 File path: src/operator/nn/softmax.cc
 ##########
 @@ -116,6 +116,45 @@ MXNET_OPERATOR_REGISTER_BINARY(_backward_softmax)
 .set_attr<FCompute>("FCompute<cpu>", SoftmaxGradCompute<cpu, op::mshadow_op::mul,
                                                         mxnet_op::softmax_bwd>);
 
+MXNET_OPERATOR_REGISTER_UNARY(softmin)
+.describe(R"code(Applies the softmin function.
+
+The resulting array contains elements in the range (0,1) and the elements along the given axis sum
+up to 1. Equivalant to `softmax(-z)` where `softmax(z)` is defined as:
+
+.. math::
+   softmax(\mathbf{z/t})_j = \frac{e^{z_j/t}}{\sum_{k=1}^K e^{z_k/t}}
+
+for :math:`j = 1, ..., K`
+
+t is the temperature parameter in softmax function. By default, t equals 1.0
+
+Example::
+
+  x = [[ 1.  2.  3.]
+       [ 3.  2.  1.]]
+
+  softmax(x,axis=0) = [[ 0.88079703,  0.5,  0.11920292],
 
 Review comment:
   Typo: this should be softmin

----------------------------------------------------------------
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