Skip to content

Optimization with bounds

ykawashima edited this page Jul 4, 2022 · 1 revision

You can perform optimization with bounds using the ScipyBoundedMinimize from jaxopt (see here) as follows. Refer to the tutorial for defining objective.

lbfgsb = ScipyBoundedMinimize(fun=objective, method="l-bfgs-b")
#Rp,RV,MMR_CO,T0,alpha,vsini,
lower_bounds = np.array([0., -jnp.inf, 0., 0., -jnp.inf, -jnp.inf])
upper_bounds = np.array([jnp.inf, jnp.inf, 1., jnp.inf, jnp.inf, jnp.inf])
bounds = (lower_bounds, upper_bounds)
params = lbfgsb.run(initpar, bounds=bounds).params