You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix critical numerical instability in UpdateVector method
The UpdateVector method had a critical bug where (1 - ||xt||²) becomes
negative when input norm exceeds 1, causing parameter explosion.
Added clipping to prevent negative scaling:
- When ||xt||² ≤ 1: Normal behavior
- When ||xt||² > 1: Falls back to standard GD (modFactor = 0)
Changes:
- Added clipping in UpdateVector (lines 101-104)
- Updated documentation with stability notes
- Now numerically stable for all input norms
**Issue**: When `||x_t||² > 1`, the modification factor becomes **negative**, causing:
417
+
- Parameters to be scaled by negative values
418
+
- Parameter explosion and oscillation
419
+
- Training instability and divergence
420
+
421
+
**Root Cause**: The scalar approximation `(1 - ||x_t||²)` becomes negative when input norm exceeds 1, unlike the matrix form `(I - x_t x_t^T)` which remains stable as a valid matrix operation.
0 commit comments