Commit graph

1 commit

Author SHA1 Message Date
Rasmus Widing
a5886b8033 fix(gnn): add gradient clipping for numerical stability
Add MAX_GRAD constant (1e6) and clip gradients in BCE and CrossEntropy
backward passes to prevent gradient explosion with extreme prediction
values near 0 or 1.

Also add examples/loss_demo.rs for manual testing and demonstration
of loss function behavior.
2025-12-09 12:45:34 +02:00