lineax
lineax copied to clipboard
Failure to raise error for ill-posed system if using LU and 32-bit
When using AutoLinearOperator
with well_posed=True
and no tags specifying some structure, the LU solver is used.
LU wraps the jax.scipy
implementation and raises an error if the output has NaN
or +/- inf
values. However, jsp.linalg.lu_solve
will not necessarily return a vector with such values for an ill-posed problem, unless one uses double-precision: https://github.com/google/jax/issues/23626
If there is no fix in JAX itself, then we could check if the solution is valid and throw an error if it's not.
I am using SVD for that particular problem anyway, but wanted to note this here since AutoLinearSolver
promises to raise an error for ill-posed problems.