newton_raphson
riemax.numerical.newton_raphson
riemax.numerical.newton_raphson.NewtonConvergenceState
Bases: typing.NamedTuple
Store for information about convergence of Newton method.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
step |
step on which the newton method stopped |
required | |
max_steps |
maximum number of steps the newton method was allowed to take |
required | |
residual |
residual of the convergence |
required | |
target_residual |
user-specified tolerance for conversion |
required |
Source code in src/riemax/numerical/newton_raphson.py
converged: bool
property
Determines whether Newton method converged for given budget.
Returns:
Type | Description |
---|---|
bool
|
whether the newton method converged |
riemax.numerical.newton_raphson.newton_raphson(fn_residual: tp.Callable[[T], T], initial_guess: T, nr_parameters: NewtonRaphsonParams | None = None) -> tuple[T, NewtonConvergenceState]
Newton-Raphson root finding for arbitrary PyTrees.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fn_residual |
typing.Callable[[T], T]
|
function to compute the residual you are trying to minimise |
required |
initial_guess |
T
|
starting point for the optimisation procedure |
required |
nr_parameters |
riemax.numerical.newton_raphson.NewtonRaphsonParams | None
|
parameters for use in the optimisation process |
None
|
Returns:
Name | Type | Description |
---|---|---|
optimised_state |
T
|
optimised state which minimises the given residual function |
nr_convergence |
riemax.numerical.newton_raphson.NewtonConvergenceState
|
auxiliary information about state of the optimisation process |