Skip to content

Commit

Permalink
chore: add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
therealansh committed Aug 17, 2021
1 parent 7cc8197 commit 1faca2f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ public class GeluActivation(public val approximate: Boolean = false) : Activatio
features, tf.math.add(
tf.constant(1.0f), tf.math.tanh(
tf.math.mul(
tf.constant(0.7978845608028654f),
tf.constant(0.7978845608028654f), // This value is equal to sqrt(2/pi) to avoid a constant division
tf.math.add(features, tf.math.mul(coeff, tf.math.pow(features, tf.constant(3f))))
)
)
Expand Down

0 comments on commit 1faca2f

Please sign in to comment.