nlsq.stability.svd_fallback.compute_svd_with_fallback¶
- nlsq.stability.svd_fallback.compute_svd_with_fallback(J_h, full_matrices=False)[source]¶
Compute full deterministic SVD with multiple fallback strategies.
This is the primary SVD function for NLSQ. It uses full (exact) SVD to ensure numerical precision and reproducibility in optimization.
Fallback chain: 1. JAX GPU SVD (if GPU available) 2. JAX CPU SVD (if GPU fails with cuSolver error) 3. NumPy SVD (last resort)
- Parameters:
J_h (jnp.ndarray) – Jacobian matrix in hat space
full_matrices (bool) – Whether to compute full matrices (default: False for efficiency)
- Returns:
U (jnp.ndarray) – Left singular vectors
s (jnp.ndarray) – Singular values (sorted in descending order)
V (jnp.ndarray) – Right singular vectors (note: V is transposed back, NOT Vt)
- Return type: