Solution¤
optimistix.Solution
¤
The solution to a nonlinear 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 viaoptimistix.RESULTS[result]aux: Any user-specified auxiliary data returned from the problem; defaults toNoneif there is no auxiliary data. Auxiliary outputs can be captured by setting ahas_aux=Trueflag, e.g.optx.root_find(fn, ..., has_aux=True).stats: Statistics about the solve, e.g. the number of steps that were required.state: The final internal state of the solver. The meaning of this is specific to each solver.
optimistix.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. -
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. -
nonlinear_max_steps_reached: The maximum number of steps was reached in the nonlinear solver. The problem may not be solveable (e.g., a root-find on a function that has no roots), or you may need to increasemax_steps. -
nonlinear_divergence: Nonlinear solve diverged.