Function minimization by brute force grid search in JAX
Project description
Brutax
When all else fails, why not a brute-force search! Brutax is a JAX library for function optimization by brute-force grid search. Features include:
- Highly-parallel function evaluations
- PyTree-valued grids
- Customizable search behavior downstream
- Smooth integration with JAX function transformations: JIT, autodiff, vectorization, and scaling across GPU/TPUs
Installation
pip install brutax
Quick example
import brutax
import jax.numpy as jnp
def fn(tree_grid_point, _):
x, y = tree_grid_point
return (x - 1.)**2 + (y - 2.)**2
# The `tree_grid` is the cartesian product of x and y grids
x_grid, y_grid = (jnp.arange(-5., 5., 1), jnp.arange(-5., 5., 0.1))
tree_grid = (x_grid, y_grid)
# Run grid search over (10 x 100) grid
sol = brutax.run_grid_search(
fn, method=brutax.MinimumSearchMethod(), tree_grid=tree_grid, args=None
)
x_min, y_min = sol.value
assert jnp.isclose(x_min, 1.) and jnp.isclose(y_min, 2.)
Acknowledgements
- The design of
brutaxis heavily inspired from the JAX non-linear optimization libraryoptimistix.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file brutax-0.0.2rc1.tar.gz.
File metadata
- Download URL: brutax-0.0.2rc1.tar.gz
- Upload date:
- Size: 16.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2f1375b6d50446b51812f5ea0f1bdf2d87406c9eafffb351e93579a74bf0e7db
|
|
| MD5 |
e1e39fffaab286e96373424614a2a071
|
|
| BLAKE2b-256 |
b5e2a7b300d41b143429567a799c85e98f0ecbf4d8c9acadca3ccdaa70783cfc
|
Provenance
The following attestation bundles were made for brutax-0.0.2rc1.tar.gz:
Publisher:
publish.yml on michael-0brien/brutax
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
brutax-0.0.2rc1.tar.gz -
Subject digest:
2f1375b6d50446b51812f5ea0f1bdf2d87406c9eafffb351e93579a74bf0e7db - Sigstore transparency entry: 854672292
- Sigstore integration time:
-
Permalink:
michael-0brien/brutax@1fc505d295140d08c89df5bac87a6ffc8460987b -
Branch / Tag:
refs/tags/v0.0.2rc1 - Owner: https://github.com/michael-0brien
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1fc505d295140d08c89df5bac87a6ffc8460987b -
Trigger Event:
release
-
Statement type:
File details
Details for the file brutax-0.0.2rc1-py3-none-any.whl.
File metadata
- Download URL: brutax-0.0.2rc1-py3-none-any.whl
- Upload date:
- Size: 19.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef77aa439cce4adb6121a49b950ac80d5cbc769f647fc572d3ac5bbff59d7f54
|
|
| MD5 |
80b5c4db4f144565c15431b33d7307d3
|
|
| BLAKE2b-256 |
b4a02f136dd267f601766321f2ee201cb41e5be459b4438a57f901fedf0cd69b
|
Provenance
The following attestation bundles were made for brutax-0.0.2rc1-py3-none-any.whl:
Publisher:
publish.yml on michael-0brien/brutax
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
brutax-0.0.2rc1-py3-none-any.whl -
Subject digest:
ef77aa439cce4adb6121a49b950ac80d5cbc769f647fc572d3ac5bbff59d7f54 - Sigstore transparency entry: 854672321
- Sigstore integration time:
-
Permalink:
michael-0brien/brutax@1fc505d295140d08c89df5bac87a6ffc8460987b -
Branch / Tag:
refs/tags/v0.0.2rc1 - Owner: https://github.com/michael-0brien
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1fc505d295140d08c89df5bac87a6ffc8460987b -
Trigger Event:
release
-
Statement type: