autobound icon indicating copy to clipboard operation
autobound copied to clipboard

Multidimensional Example

Open Downsite opened this issue 8 months ago • 0 comments

It would be nice to expand the README to show how to use autobound with vector-valued inputs and interpret the output. From looking into the code, I thought that

 import autobound.jax as ab
 import jax.numpy as jnp
 f = lambda x: 1.5*jnp.exp(3.0*x[1]*x[0]) - 25.0*x[0]**2
 trust_region = (jnp.array([0,0]),jnp.array([1,1]))
 x0 = jnp.array([.5,.5])
 bounds = ab.taylor_bounds(f,max_degree=2)(x0,trust_region)

should work, but that runs into issues with dynamic_slice not being implemented. The following worked:

A= jnp.array([0,1])
B= jnp.array([1,0])
f = lambda x: 1.5*jnp.exp(3.0*jnp.dot(A,x)*jnp.dot(B,x)) - 25*jnp.dot(B,x)**2

Perhaps there is an intended, easier way I am missing?

Downsite avatar Jun 12 '24 11:06 Downsite