activation_gelu {keras3} | R Documentation |
Gaussian error linear unit (GELU) activation function.
Description
The Gaussian error linear unit (GELU) is defined as:
gelu(x) = x * P(X <= x)
where P(X) ~ N(0, 1)
,
i.e. gelu(x) = 0.5 * x * (1 + erf(x / sqrt(2)))
.
GELU weights inputs by their value, rather than gating inputs by their sign as in ReLU.
Usage
activation_gelu(x, approximate = FALSE)
Arguments
x |
Input tensor. |
approximate |
A |
Value
A tensor, the result from applying the activation to the input tensor x
.
Reference
See Also
Other activations:
activation_elu()
activation_exponential()
activation_hard_sigmoid()
activation_leaky_relu()
activation_linear()
activation_log_softmax()
activation_mish()
activation_relu()
activation_relu6()
activation_selu()
activation_sigmoid()
activation_silu()
activation_softmax()
activation_softplus()
activation_softsign()
activation_tanh()
[Package keras3 version 1.1.0 Index]