Skip to main content

No project description provided

Project description

AutoBound: Automatically Bounding Functions

PyPI version

AutoBound is a generalization of automatic differentiation. In addition to computing a Taylor polynomial approximation of a function, it computes upper and lower bounds that are guaranteed to hold over a user-specified trust region.

As an example, here are the quadratic upper and lower bounds AutoBound computes for the function f(x) = 1.5*exp(3*x) - 25*(x**2), centered at 0.5, and valid over the trust region [0, 1].

Example quadratic upper and lower bounds

The code to compute the bounds shown in this plot looks like this (see quickstart):

import autobound.jax as ab
import jax.numpy as jnp

f = lambda x: 1.5*jnp.exp(3*x) - 25*x**2
x0 = .5
trust_region = (0, 1)
# Compute quadratic upper and lower bounds on f.
bounds = ab.taylor_bounds(f, 2)(x0, trust_region)
# bounds.upper(1) == 5.1283045 == f(1)
# bounds.lower(0) == 1.5 == f(0)
# bounds.coefficients == (0.47253323, -4.8324013, (-5.5549355, 28.287888))

These bounds can be used for:

and more!

Under the hood, AutoBound computes these bounds using an interval arithmetic variant of Taylor-mode automatic differentiation. Accordingly, the memory requirements are linear in the input dimension, and the method is only practical for functions with low-dimensional inputs. A reverse-mode algorithm that efficiently handles high-dimensional inputs is under development.

A detailed description of the AutoBound algorithm can be found in this paper.

Installation

Assuming you have installed pip, you can install this package directly from GitHub with

pip install git+https://github.com/google/autobound.git

or from PyPI with

pip install autobound

You may need to upgrade pip before running these commands.

Limitations

The current code has a few limitations:

  • Only JAX-traceable functions can be automatically bounded.
  • Many JAX library functions are not yet supported. What is supported is bounding the squared error loss of a multi-layer perceptron or convolutional neural network that uses the jax.nn.sigmoid, jax.nn.softplus, or jax.nn.swish activation functions.
  • To compute accurate bounds for deeper neural networks, you may need to use float64 rather than float32.

Citing AutoBound

To cite this repository:

@article{autobound2022,
  title={Automatically Bounding the Taylor Remainder Series: Tighter Bounds and New Applications},
  author={Streeter, Matthew and Dillon, Joshua V},
  journal={arXiv preprint arXiv:2212.11429},
  url = {http://github.com/google/autobound},
  year={2022}
}

This is not an officially supported Google product.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

autobound-0.1.7.tar.gz (50.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

autobound-0.1.7-py3-none-any.whl (64.0 kB view details)

Uploaded Python 3

File details

Details for the file autobound-0.1.7.tar.gz.

File metadata

  • Download URL: autobound-0.1.7.tar.gz
  • Upload date:
  • Size: 50.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for autobound-0.1.7.tar.gz
Algorithm Hash digest
SHA256 35ca25a24c933aa410726a41924da7f833cf4abfcff8d1ace1b4687e40546bc8
MD5 ec7d92229db59dea2f1c3d2628cc0fc1
BLAKE2b-256 3ccb9beab42d7462db11f0e054a4be268c16c28572125998f9ac1499936a0f3b

See more details on using hashes here.

File details

Details for the file autobound-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: autobound-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 64.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for autobound-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 a55d0ac4838f2c0777433622167fad4992ea8e331a1b444cd4b79d570c6f4f30
MD5 303e9194338f3f5ad5c352886c636a34
BLAKE2b-256 8f6bdb796e7b3ea819cda1a5d8b99fc289209c9306ebb3410c4a510ea111b747

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page