fmin_l_bfgs_b(func, x0, fprime=None, args=(), approx_grad=0, bounds=None, m=10, factr=10000000.0, pgtol=1e-05, epsilon=1e-08, iprint=-1, maxfun=15000, maxiter=15000, disp=None, callback=None, maxls=20)
License of L-BFGS-B (FORTRAN code):
The version included here (in fortran code) is 3.0 (released April 25, 2011). 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. This software is released under the BSD License.
Function to minimize.
Initial guess.
The gradient of :None:None:`func`
. If None, then :None:None:`func`
returns the function value and the gradient ( f, g = func(x, *args)
), unless :None:None:`approx_grad`
is True in which case :None:None:`func`
returns only f
.
Arguments to pass to :None:None:`func`
and fprime
.
Whether to approximate the gradient numerically (in which case :None:None:`func`
returns only the function value).
(min, max)
pairs for each element in x
, defining the bounds on that parameter. Use None or +-inf for one of min
or max
when there is no bound in that direction.
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.)
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 :None:None:`factr`
are: 1e12 for low accuracy; 1e7 for moderate accuracy; 10.0 for extremely high accuracy. See Notes for relationship to :None:None:`ftol`
, which is exposed (instead of :None:None:`factr`
) by the scipy.optimize.minimize
interface to L-BFGS-B.
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.
Step size used when :None:None:`approx_grad`
is True, for numerically calculating the gradient
Controls the frequency of output. iprint < 0
means no output; iprint = 0
print only one line at the last iteration; 0 < iprint < 99
print also f and |proj g|
every iprint iterations; iprint = 99
print details of every iteration except n-vectors; iprint = 100
print also the changes of active set and final x; iprint > 100
print details of every iteration including x and g.
If zero, then no output. If a positive number, then this over-rides :None:None:`iprint`
(i.e., :None:None:`iprint`
gets the value of :None:None:`disp`
).
Maximum number of function evaluations. Note that this function may violate the limit because of evaluating gradients by numerical differentiation.
Maximum number of iterations.
Called after each iteration, as callback(xk)
, where xk
is the current parameter vector.
Maximum number of line search steps (per iteration). Default is 20.
Estimated position of the minimum.
Value of :None:None:`func`
at the minimum.
Information dictionary.
d['warnflag'] is
0 if converged,
1 if too many function evaluations or too many iterations,
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.
d['nit'] is the number of iterations.
Minimize a function func using the L-BFGS-B algorithm.
minimize
Interface to minimization algorithms for multivariate functions. See the 'L-BFGS-B' :None:None:`method`
in particular. Note that the :None:None:`ftol`
option is made available via that interface, while :None:None:`factr`
is provided via this interface, where :None:None:`factr`
is the factor multiplying the default machine floating-point precision to arrive at :None:None:`ftol`
: ftol = factr * numpy.finfo(float).eps
.
The following pages refer to to this document either explicitly or contain code examples using this.
scipy.optimize._lbfgsb_py._minimize_lbfgsb
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them