Training needs the gradient of GELU, not just its value. Because GELU is a product of x and the Gaussian CDF, the derivative has a simple closed form that backpropagation uses directly.
Implement gelu_derivative(x), returning Phi(x) + x * phi(x) element-wise.
phi(x) = exp(-x^2 / 2) / sqrt(2 pi).Apply the product rule to x * Phi(x): the derivative is Phi(x) plus x times the density phi(x).
No results yet
Run your code to check it against the examples, or submit to run every test.