google / google/autobound

Multidimensional Example

Open
#13 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
365
Forks
20
PR merge metrics
No merged PRs in 30d

Description

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

```python
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:

```python
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?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.