minimize(method=’trust-ncg’)¶
-
torchmin.trustregion.
_minimize_trust_ncg
(fun, x0, **trust_region_options)[source]¶ Minimization of scalar function of one or more variables using the Newton conjugate gradient trust-region algorithm.
- Parameters
fun (callable) – Scalar objective function to minimize.
x0 (Tensor) – Initialization point.
initial_trust_radius (float) – Initial trust-region radius.
max_trust_radius (float) – Maximum value of the trust-region radius. No steps that are longer than this value will be proposed.
eta (float) – Trust region related acceptance stringency for proposed steps.
gtol (float) – Gradient norm must be less than
gtol
before successful termination.
- Returns
result – Result of the optimization routine.
- Return type
OptimizeResult
Notes
This is algorithm (7.2) of Nocedal and Wright 2nd edition. Only the function that computes the Hessian-vector product is required. The Hessian itself is not required, and the Hessian does not need to be positive semidefinite.