Joshua George Albert 02009e0cf0
BFGS algorithm (#3101)
* BFGS algorithm
Addressing https://github.com/google/jax/issues/1400

* * addresses @shoyer comments of PR

* * skip dtype checks

* * backslash in docstring

* * increase closeness tol

* * increase closeness atol to 1.6e-6

* * addresses jakevdp comments

* * same line search as scipy
* same results format
* same (and more) testing as in scipy for line search and bfgs
* 2 spacing
* documenting
* analytic hessian non default but still available
* NamedTuple classes

* * small fix in setup_method

* * small doc string addition

* * increase atol to 2e-5 for comparison

* * removed experimental analytic_hessian
* using jnp.where for all binary replace operations
* removed _nojit as this is what disable_jit does

* * fix indentation mangling
* remove remaining _nojit

* * fixing more indentation mangling

* * segregate third_party test

* * use parametrise

* * use parametrise

* * minor nitpicking

* * fix some errors

* * use _CompileAndCheck

* * replace f_0 and g_0 for (ugly) scipy variable names

* * remove unused function

* * fix spacing

* * add args argument to minimize
* adhere fmin_bfgs to scipy api

* * remove unused function

* * ignore F401

* * look into unittest

* * fix unittest error

* * delete unused function
* more adherence to scipy's api
* add scipy's old_old_fval arg though unused
* increase line_search default maxiter to 20 (10 not enough in some cases)

* * remove unused imports

* * add ord=norm to the initial convergence check

* * remove helper function

* * merge jax/master

* * Resolve a remnant conflict from merging master to solve ReadTheDocs issue.

* * Add an informative termination message and status number.

* Revert changes to unrelated files

* cleanup bfgs_minimize

* cleanup minimize.py

* Move minimize_bfgs.py to _bfgs.py

* Move more modules around

* improve docs

* high precision einsum

* Formatting in line search

* fixup

* Type checking

* fix mypy failures

* minor fixup

Co-authored-by: Stephan Hoyer <shoyer@google.com>
2020-07-29 14:14:40 -07:00

30 lines
1.5 KiB
Plaintext

Copyright (c) 2001-2002 Enthought, Inc. 2003-2019, SciPy Developers.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.