Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions tests/lbfgsb_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
except ImportError:
from jax.experimental import enable_x64

# Uncomment this line to test in x64
# Uncomment this line to test in x64
# jax.config.update('jax_enable_x64', True)

class LbfgsbTest(test_util.JaxoptTestCase):
Expand Down Expand Up @@ -100,7 +100,8 @@ def fun(x): # Rosenbrock function.
x, _ = lbfgsb.run(x0, bounds=(lower, upper))

# the Rosenbrock function is zero at its minimum
self.assertLessEqual(fun(x), 1e-3)
# Loosened to 1.5e-3 due to float32 precision limits after dot strength reduction on CPU.
self.assertLessEqual(fun(x), 1.5e-3)

@parameterized.parameters(
((0., -5., 0), (2., 0., 1)),
Expand Down Expand Up @@ -269,7 +270,7 @@ def fit_objective(pars, data, x):
data = jnp.array(1.5)
res = grad_fn(0.5, jnp.array(0.0), (jnp.array(0.0), jnp.array(10.0)), data)
self.assertEqual(res, data)

def test_linear_in_box(self):
# Fixing issue #492
def fun(x):
Expand Down
Loading