mushi.optimization.LineSearcher

class LineSearcher(s0=1, max_line_iter=100, gamma=0.8, verbose=False)[source]

Bases: mushi.optimization.Optimizer

Abstract class for an optimizer with Armijo line search.

Parameters
  • s0 (float64) – initial step size

  • max_line_iter (int) – maximum number of line search steps

  • gamma (float64) – step size shrinkage rate for line search

  • verbose (bool) – flag to print convergence messages

Methods

f

Evaluate cost function at current solution point.

run

Optimize until convergence criteria are met.

abstract f()

Evaluate cost function at current solution point.

Return type

float64

run(x, tol=1e-06, max_iter=100)

Optimize until convergence criteria are met.

Parameters
  • x (ndarray) – initial point

  • tol (float64) – relative tolerance in objective function

  • max_iter (int) – maximum number of iterations

Returns

solution point

Return type

x