mushi.optimization.Optimizer

class Optimizer(verbose=False)[source]

Bases: object

Abstract base class for optimizers.

x

solution point

Parameters

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()[source]

Evaluate cost function at current solution point.

Return type

float64

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

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