# mlx.nn.gelu_fast_approx — MLX 0.0.7 documentation

Skip to main content
`Ctrl`+`K`

# mlx.nn.gelu_fast_approx

class mlx.nn.gelu_fast_approx(x)

  A fast approximation to Gaussian Error Linear Unit.

  See `gelu()` for the exact computation.

  This function approximates `gelu` with a maximum absolute error \(< 0.015\) in the range \([-6, 6]\) using the following

  \[x = x \sigma\left(1.773 x\right)\]

  where \(\sigma(\cdot)\) is the logistic sigmoid.