Skip to main content

Module nn

Module nn 

Source
Expand description

Small CPU math helpers for the f32 reference path.

Functionsยง

l2_norm
L2-normalize with eps, in place: x / sqrt(sum(x^2) + eps).
rms_norm
RMSNorm: x_i * w_i / sqrt(mean(x^2) + eps). Computed in f32.
sigmoid
silu
SiLU activation: x * sigmoid(x).
softmax
In-place softmax over x.
softplus