Skip to content

Commit

Permalink
Release 0.3.
Browse files Browse the repository at this point in the history
  • Loading branch information
mblondel committed Jan 31, 2022
1 parent ea151c1 commit 7544c59
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 7 deletions.
17 changes: 17 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,20 @@ Line search
:toctree: _autosummary

jaxopt.BacktrackingLineSearch

Tree utilities
--------------

.. autosummary::
:toctree: _autosummary

jaxopt.tree_util.tree_add
jaxopt.tree_util.tree_sub
jaxopt.tree_util.tree_mul
jaxopt.tree_util.tree_div
jaxopt.tree_util.tree_scalar_mul
jaxopt.tree_util.tree_add_scalar_mul
jaxopt.tree_util.tree_vdot
jaxopt.tree_util.tree_sum
jaxopt.tree_util.tree_l2_norm
jaxopt.tree_util.tree_zeros_like
14 changes: 10 additions & 4 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,22 @@ Version 0.3
New features
~~~~~~~~~~~~

- :class:`jaxopt.LBFGS`.
- :class:`jaxopt.BacktrackingLineSearch`.
- :class:`jaxopt.GaussNewton`.
- :class:`jaxopt.LBFGS`
- :class:`jaxopt.BacktrackingLineSearch`
- :class:`jaxopt.GaussNewton`
- :class:`jaxopt.NonlinearCG`

Bug fixes and enhancements
~~~~~~~~~~~~~~~~~~~~~~~~~~

- `Support implicit AD in higher-order differentiation
<https://github.com/google/jaxopt/pull/143>`_.

Contributors
~~~~~~~~~~~~

Amir Saadat, Fabian Pedregosa, Geoffrey Négiar, Hyunsung Lee, Mathieu Blondel, Roy Frostig.

Version 0.2
-----------

Expand Down Expand Up @@ -48,7 +54,7 @@ Bug fixes and enhancements
Deprecations
~~~~~~~~~~~~

- :class:`jaxopt.QuadraticProgramming` is deprecated and will be removed in v0.3. Use
- :class:`jaxopt.QuadraticProgramming` is deprecated and will be removed in v0.4. Use
:class:`jaxopt.CvxpyQP`, :class:`jaxopt.OSQP`, :class:`jaxopt.BoxOSQP` and
:class:`jaxopt.EqualityConstrainedQP` instead.
- ``params, state = solver.init(...)`` is deprecated. Use ``state = solver.init_state(...)`` instead.
Expand Down
3 changes: 2 additions & 1 deletion docs/unconstrained.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ instantiated and run as follows::
# Alternatively, we could have used one of these solvers as well:
# solver = jaxopt.GradientDescent(fun=ridge_reg_objective, maxiter=500)
# solver = jaxopt.ScipyMinimize(fun=ridge_reg_objective, method="L-BFGS-B", maxiter=500)
# cg_model = jaxopt.NonlinearCG(fun=ridge_reg_objective, maxiter=300, method="polak-ribiere")
# solver = jaxopt.NonlinearCG(fun=ridge_reg_objective, method="polak-ribiere", maxiter=500)

Unpacking results
~~~~~~~~~~~~~~~~~

Expand Down
4 changes: 2 additions & 2 deletions jaxopt/_src/quadratic_prog.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def ineq_fun(primal_var, params_ineq):

@dataclass(eq=False)
class QuadraticProgramming(base.Solver):
"""Deprecated: will be removed in v0.3.
"""Deprecated: will be removed in v0.4.
Use :class:`jaxopt.CvxpyQP`, :class:`jaxopt.OSQP`, :class:`jaxopt.BoxOSQP` and
:class:`jaxopt.EqualityConstrainedQP` instead.
Expand Down Expand Up @@ -233,7 +233,7 @@ def l2_optimality_error(
return tree_util.tree_l2_norm(pytree)

def __post_init__(self):
warnings.warn("Class 'QuadraticProgramming' will be removed in v0.3. "
warnings.warn("Class 'QuadraticProgramming' will be removed in v0.4. "
"Use 'EqualityConstraintsQP' if you want the same behavior as "
"'QuadraticProgramming' for QPs with equality constraints only. "
"Use 'CVXPY_QP' if you want the same behavior as "
Expand Down
7 changes: 7 additions & 0 deletions jaxopt/_src/tree_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,16 @@
tree_unflatten = tu.tree_unflatten

tree_add = functools.partial(tree_multimap, operator.add)
tree_add.__doc__ = "Tree addition."

tree_sub = functools.partial(tree_multimap, operator.sub)
tree_sub.__doc__ = "Tree subtraction."

tree_mul = functools.partial(tree_multimap, operator.mul)
tree_mul.__doc__ = "Tree multiplication."

tree_div = functools.partial(tree_multimap, operator.truediv)
tree_div.__doc__ = "Tree division."


def tree_scalar_mul(scalar, tree_x):
Expand Down

0 comments on commit 7544c59

Please sign in to comment.