minimize(method=’l-bfgs’)¶
-
torchmin.bfgs._minimize_lbfgs(fun, x0, lr=1.0, history_size=100, max_iter=None, line_search='strong-wolfe', gtol=1e-05, xtol=1e-08, gtd_tol=1e-10, normp=inf, callback=None, disp=0, return_all=False)[source]¶ Minimize a multivariate function with L-BFGS
- Parameters
fun (callable) – Scalar objective function to minimize.
x0 (Tensor) – Initialization point.
lr (float) – Step size for parameter updates. If using line search, this will be used as the initial step size for the search.
history_size (int) – History size for L-BFGS hessian estimates.
max_iter (int, optional) – Maximum number of iterations to perform. Defaults to
200 * x0.numel().line_search (str) – Line search specifier. Currently the available options are {‘none’, ‘strong-wolfe’}.
gtol (float) – Termination tolerance on 1st-order optimality (gradient norm).
xtol (float) – Termination tolerance on function/parameter changes.
gtd_tol (float) – Tolerence used to verify that the search direction is a descent direction. The directional derivative gtd should be negative for descent; this check ensures that gtd < -xtol (sufficiently negative).
normp (Number or str) – The norm type to use for termination conditions. Can be any value supported by
torch.norm().callback (callable, optional) – Function to call after each iteration with the current parameter state, e.g.
callback(x).disp (int or bool) – Display (verbosity) level. Set to >0 to print status messages.
return_all (bool, optional) – Set to True to return a list of the best solution at each of the iterations.
- Returns
result – Result of the optimization routine.
- Return type
OptimizeResult