Пример #1
0
def Gelu():
  r"""Returns a layer that computes the Gaussian Error Linear Unit function.

  .. math::
      f(x) = \frac{x}{2} \cdot (1 + \hbox{erf}(\frac{x}{\sqrt{2}}))
  """
  return Fn('Gelu', lambda x: x * 0.5 * (1.0 + math.erf(x / np.sqrt(2.0))))
Пример #2
0
def Gelu():
    return Fn('Gelu', lambda x: x * 0.5 * (1.0 + math.erf(x / np.sqrt(2.0))))
Пример #3
0
def Gelu(x):
    return x * 0.5 * (1.0 + math.erf(x / np.sqrt(2.0)))
Пример #4
0
def Gelu(x, **unused_kwargs):
    return x * 0.5 * (1.0 + math.erf(x / np.sqrt(2.0)))