17.1.1.11. pysisyphus.line_searches package
17.1.1.11.1. Submodules
17.1.1.11.2. pysisyphus.line_searches.Backtracking module
- class pysisyphus.line_searches.Backtracking.Backtracking(*args, rho_lo=0.05, rho_hi=0.9, use_grad=False, **kwargs)[source]
Bases:
LineSearch
17.1.1.11.3. pysisyphus.line_searches.HagerZhang module
- class pysisyphus.line_searches.HagerZhang.HagerZhang(*args, alpha_prev=None, f_prev=None, dphi0_prev=None, quad_step=False, eps=1e-06, theta=0.5, gamma=0.5, rho=5, psi_0=0.01, psi_1=0.1, psi_2=2.0, psi_low=0.1, psi_hi=10, Delta=0.7, omega=0.001, max_bisects=10, **kwargs)[source]
Bases:
LineSearch
17.1.1.11.4. pysisyphus.line_searches.LineSearch module
- class pysisyphus.line_searches.LineSearch.LineSearch(p, x0, f, df, alpha_init=None, f0=None, g0=None, cond='armijo', c1=0.1, c2=0.9, max_cycles=10, alpha_min=1e-06, logger=None)[source]
Bases:
object
- __init__(p, x0, f, df, alpha_init=None, f0=None, g0=None, cond='armijo', c1=0.1, c2=0.9, max_cycles=10, alpha_min=1e-06, logger=None)[source]
Abstract line search base class.
Derived line search classes can either be instantiated from a search direction p and the other required arrays and callables, OR from a geometry object, a search direction p and other kwargs. In the latter case the appropriate arguments are derived automatically from the geometry object. Please see the from_geom() method definition. This is realized via functools.singledispatchmethod.
HagerZhang(p, x0, f, ...) or HagerZhang(geometry, p, ...)
Choice of variable names (p, c1, c2, ...) is adapted from "Nocedal & Wright - Numerical Optimization".
- Parameters:
p (
ndarray
) -- 1d numpy array containing the step direction, along which the line search is carried out.x0 (
ndarray
) -- 1d array of initial coordinates, from where the line search is started.f (
Callable
) -- Callable taking a 1d coordinate array as argument, returning the corresponding energy.df (
Callable
) -- Callable taking a 1d coordinate array as argument, returning the corresponding 1d gradient array.alpha_init (
Optional
[float
], default:None
) -- Optional, positive float. Initial step scaling value alpha.f0 (
Optional
[ndarray
], default:None
) -- Optional, scalar energy value at x0.g0 (
Optional
[ndarray
], default:None
) -- Optional, 1d gradient array at x0.cond (
Literal
['armijo'
,'wolfe'
,'strong_wolfe'
], default:'armijo'
) -- Condition to be fulfilled by the line search. Must be one of 'armijo', 'wolfe', 'strong_wolfe'.c1 (
float
, default:0.1
) -- Optional, positive float controlling the strictness of the selected condition. Must fullfil 0.0 < c1 < c2 < 1.0c2 (
float
, default:0.9
) -- Optional, positive float controlling the strictness of the selected condition. Must fullfil 0.0 < c1 < c2 < 1.0. Depending on the condition c2 may be unused.max_cycles (
int
, default:10
) -- Optional, positive integer controlling the maximum number of cycles in one line search.alpha_min (
float
, default:1e-06
) -- Optional, positive float value giving the smallest allowed alpha value, before the line search is aborted.
- class pysisyphus.line_searches.LineSearch.LineSearchResult(converged, alpha, f_new, g_new, f_evals, df_evals, dphi0)
Bases:
tuple
- alpha
Alias for field number 1
- converged
Alias for field number 0
- df_evals
Alias for field number 5
- dphi0
Alias for field number 6
- f_evals
Alias for field number 4
- f_new
Alias for field number 2
- g_new
Alias for field number 3
17.1.1.11.5. pysisyphus.line_searches.StrongWolfe module
- class pysisyphus.line_searches.StrongWolfe.StrongWolfe(*args, alpha_max=10.0, fac=2, **kwargs)[source]
Bases:
LineSearch
17.1.1.11.6. pysisyphus.line_searches.interpol module
17.1.1.11.7. Module contents
- class pysisyphus.line_searches.Backtracking(*args, rho_lo=0.05, rho_hi=0.9, use_grad=False, **kwargs)[source]
Bases:
LineSearch
- class pysisyphus.line_searches.HagerZhang(*args, alpha_prev=None, f_prev=None, dphi0_prev=None, quad_step=False, eps=1e-06, theta=0.5, gamma=0.5, rho=5, psi_0=0.01, psi_1=0.1, psi_2=2.0, psi_low=0.1, psi_hi=10, Delta=0.7, omega=0.001, max_bisects=10, **kwargs)[source]
Bases:
LineSearch
- class pysisyphus.line_searches.StrongWolfe(*args, alpha_max=10.0, fac=2, **kwargs)[source]
Bases:
LineSearch