From 73014f9f0dd13137f73f457883c44b2d61d8a405 Mon Sep 17 00:00:00 2001 From: Robert Dyro Date: Mon, 27 Jan 2025 20:17:34 -0800 Subject: [PATCH] update doctest in lbfgs --- optax/_src/alias.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/optax/_src/alias.py b/optax/_src/alias.py index 1a38b4e2..1cbe9bab 100644 --- a/optax/_src/alias.py +++ b/optax/_src/alias.py @@ -2475,7 +2475,7 @@ def lbfgs( Objective function: 14.0 >>> opt_state = solver.init(params) >>> value_and_grad = optax.value_and_grad_from_state(f) - >>> for _ in range(5): + >>> for _ in range(2): ... value, grad = value_and_grad(params, state=opt_state) ... updates, opt_state = solver.update( ... grad, opt_state, params, value=value, grad=grad, value_fn=f @@ -2484,9 +2484,6 @@ def lbfgs( ... print('Objective function: {:.2E}'.format(f(params))) Objective function: 7.52E+00 Objective function: 7.46E-14 - Objective function: 2.65E-28 - Objective function: 0.00E+00 - Objective function: 0.00E+00 References: Algorithms 7.4, 7.5 (page 199) of Nocedal et al, `Numerical Optimization