Read the equation
GELU multiplies x by the standard normal cumulative probability at x. The function implements it with erf, giving a smooth activation that attenuates many negative values and approaches x for large positive values. The Φ in this formula is a Gaussian CDF, not the project’s unity score or an IIT quantity.
Terms & definitions
| Term | Meaning in this source |
|---|---|
| x | Activation input |
| Phi | Standard normal cumulative distribution function |
How it works
Read the definition from its right-hand expression to the quantity on the left. Its surrounding source records the intended input, state, or parameter context. Where the source leaves an operation unspecified, this page preserves that gap.
Assumptions & limits
Source recovery establishes that the expression appears in this record. Its mathematical validity, implementation behavior, and interpretation must be assessed separately. See the linked source and research notes for the checks available for this version.
Original context
Read the surrounding source passage
result[i] = (v-mean)/std*gamma + beta
}
return result
}
// GELU computes Gaussian Error Linear Unit
// GELU(x) = x · Φ(x) where Φ is the CDF of N(0,1)
func GELU(x float64) float64 {
return 0.5 * x * (1.0 + math.Erf(x/math.Sqrt(2.0)))
}
// SwiGLU computes SwiGLU activation
// SwiGLU(x, W, V, b, c) = Swish(xW + b) ⊗ (xV + c)
func SwiGLU(x []float64, gate, linear []float64) []float64 {
n := len(x)
if n == 0 || len(gate) != n || len(linear) != n {
return xExact original notation
GELU(x) = x · Φ(x) where Φ is the CDF of N(0,1)