| ggml_gelu_back | R Documentation |
Gradient of the GELU activation: dx = dy * dgelu(x). Wired into the
autodiff engine, so ggml_compile(activation = "gelu") trains – this
is a ggmlR extension, upstream ggml has no GELU backward and aborts instead.
ggml_gelu_back(ctx, a, b)
ctx |
GGML context |
a |
Gradient tensor from upstream ( |
b |
Forward input tensor ( |
The derivative is that of the tanh approximation ggml_gelu
computes,
g(x) = 0.5x(1 + tanh(u)) with u = c*x*(1 + a*x^2). The quick
and erf variants (ggml_gelu_quick, ggml_gelu_erf)
are different functions with different derivatives and remain without a
backward rule.
Gradient tensor for the input
ggml_gelu, ggml_silu_back
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.