Package linear_operators :: Package iterative :: Module optimize :: Class FminLBFGSB
[hide private]
[frames] | no frames]

Class FminLBFGSB

source code

 object --+    
          |    
FminWrapper --+
              |
             FminLBFGSB


Abstract class to generate wrappers around scipy.optimize fmin_*
functions.

Parameters
-----------

criterion : Criterion
    A criterion function with __call__ and gradient methods.
x0 : ndarray (None)
    First guess
args=() : tuple
    Extra arguments for the criterion function
kwargs : dict
    Parameters of the fmin_function

fmin function docstring
------------------------

Minimize a function func using the L-BFGS-B algorithm.

Parameters
----------
func : callable f(x, *args)
    Function to minimise.
x0 : ndarray
    Initial guess.
fprime : callable fprime(x, *args)
    The gradient of `func`.  If None, then `func` returns the function
    value and the gradient (``f, g = func(x, *args)``), unless
    `approx_grad` is True in which case `func` returns only ``f``.
args : tuple
    Arguments to pass to `func` and `fprime`.
approx_grad : bool
    Whether to approximate the gradient numerically (in which case
    `func` returns only the function value).
bounds : list
    ``(min, max)`` pairs for each element in ``x``, defining
    the bounds on that parameter. Use None for one of ``min`` or
    ``max`` when there is no bound in that direction.
m : int
    The maximum number of variable metric corrections
    used to define the limited memory matrix. (The limited memory BFGS
    method does not store the full hessian but uses this many terms in an
    approximation to it.)
factr : float
    The iteration stops when
    ``(f^k - f^{k+1})/max{|f^k|,|f^{k+1}|,1} <= factr * eps``,
    where ``eps`` is the machine precision, which is automatically
    generated by the code. Typical values for `factr` are: 1e12 for
    low accuracy; 1e7 for moderate accuracy; 10.0 for extremely
    high accuracy.
pgtol : float
    The iteration will stop when
    ``max{|proj g_i | i = 1, ..., n} <= pgtol``
    where ``pg_i`` is the i-th component of the projected gradient.
epsilon : float
    Step size used when `approx_grad` is True, for numerically
    calculating the gradient
iprint : int
    Controls the frequency of output. ``iprint < 0`` means no output.
disp : int, optional
    If zero, then no output.  If positive number, then this over-rides
    `iprint`.
maxfun : int
    Maximum number of function evaluations.

Returns
-------
x : ndarray
    Estimated position of the minimum.
f : float
    Value of `func` at the minimum.
d : dict
    Information dictionary.

    * d['warnflag'] is
      - 0 if converged,
      - 1 if too many function evaluations,
      - 2 if stopped for another reason, given in d['task']

    * d['grad'] is the gradient at the minimum (should be 0 ish)
    * d['funcalls'] is the number of function calls made.

Notes
-----
License of L-BFGS-B (Fortran code):

The version included here (in fortran code) is 2.1 (released in 1997).
It was written by Ciyou Zhu, Richard Byrd, and Jorge Nocedal
<nocedal@ece.nwu.edu>. It carries the following condition for use:

This software is freely available, but we expect that all publications
describing work using this software , or all commercial products using it,
quote at least one of the references given below.

References
----------
* R. H. Byrd, P. Lu and J. Nocedal. A Limited Memory Algorithm for Bound
  Constrained Optimization, (1995), SIAM Journal on Scientific and
  Statistical Computing , 16, 5, pp. 1190-1208.
* C. Zhu, R. H. Byrd and J. Nocedal. L-BFGS-B: Algorithm 778: L-BFGS-B,
  FORTRAN routines for large scale bound constrained optimization (1997),
  ACM Transactions on Mathematical Software, Vol 23, Num. 4, pp. 550 - 560.

Instance Methods [hide private]
 
__call__(self) source code

Inherited from FminWrapper: __init__, first_guess

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  __doc__ = FminWrapper.__doc__+ opt.fmin_l_bfgs_b.__doc__
Properties [hide private]

Inherited from object: __class__