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 2022/05/25 07:59:18 UTC

[GitHub] [incubator-mxnet] bgawrych commented on a diff in pull request #21034: [FEATURE] Add tanh approximation for GeLU activation

bgawrych commented on code in PR #21034:
URL: https://github.com/apache/incubator-mxnet/pull/21034#discussion_r881341406


##########
src/api/operator/numpy_extension/npx_leaky_relu_op.cc:
##########
@@ -41,8 +41,10 @@ inline int String2ActType(const std::string& s) {
     return leakyrelu::kELU;
   } else if (s == "selu") {
     return leakyrelu::kSELU;
-  } else if (s == "gelu") {
-    return leakyrelu::kGELU;
+  } else if (s == "gelu" || s == "gelu_erf") {

Review Comment:
   backward compability



##########
src/operator/leaky_relu.cc:
##########
@@ -166,7 +166,10 @@ when the input is negative and has a slope of one when input is positive.
 The following modified ReLU Activation functions are supported:
 
 - *elu*: Exponential Linear Unit. `y = x > 0 ? x : slope * (exp(x)-1)`
-- *gelu*: Gaussian Error Linear Unit. `y = 0.5 * x * (1 + erf(x / sqrt(2)))`
+- *gelu*: Same as gelu_erf
+- *gelu_erf*: Gaussian Error Linear Unit. `y = 0.5 * x * (1 + erf(x / sqrt(2)))`

Review Comment:
   done



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

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org