Solution¤
lineax.Solution
¤
The solution to a linear solve.
Attributes:
value: The solution to the solve.result: An integer representing whether the solve was successful or not. This can be converted into a human-readable error message vialineax.RESULTS[result].stats: Statistics about the solver, e.g. the number of steps that were required.state: The internal state of the solver. The meaning of this is specific to each solver.
lineax.RESULTS
¤
An enumeration, with the following entries:
-
successful -
max_steps_reached: The maximum number of solver steps was reached. Try increasingmax_steps. -
singular: A linear solver returned non-finite (NaN or inf) output. This usually means that an operator was not well-posed, and that its solver does not support this.If you are trying solve a linear least-squares problem then you should pass
solver=AutoLinearSolver(well_posed=False). By defaultlineax.linear_solveassumes that the operator is square and nonsingular.If you were expecting this solver to work with this operator, then it may be because:
(a) the operator is singular, and your code has a bug; or
(b) the operator was nearly singular (i.e. it had a high condition number:
jnp.linalg.cond(operator.as_matrix())is large), and the solver suffered from numerical instability issues; or(c) the operator is declared to exhibit a certain property (e.g. positive definiteness) that is does not actually satisfy.
-
breakdown: A form of iterative breakdown has occured in a linear solve. Try using a different solver for this problem or increaserestartif using GMRES. -
stagnation: A stagnation in an iterative linear solve has occurred. Try increasingstagnation_itersorrestart. -
conlim: Condition number of A seems to be larger thanconlim. -
nonfinite_input: A linear solver received non-finite (NaN or inf) input and cannot determine a solution.This means that you have a bug upstream of Lineax and should check the inputs to
lineax.linear_solvefor non-finite values.