Skip to main content

tests Docs PyPI

[!NOTE] Bayex is currently a minimal, personally developed implementation that requires further development for broader application. If you're interested in engaging with Jax and enhancing Bayex, your contributions would be highly welcomed and appreciated.

Installation | Usage | Reference docs

Bayex is a lightweight Bayesian optimization library designed for efficiency and flexibility, leveraging the power of JAX for high-performance numerical computations. This library aims to provide an easy-to-use interface for optimizing expensive-to-evaluate functions through Gaussian Process (GP) models and various acquisition functions. Whether you're maximizing or minimizing your objective function, Bayex offers a simple yet powerful set of tools to guide your search for optimal parameters.

Installation

Bayex can be installed using PyPI via pip:

pip install bayex

Usage

Using Bayex is quite simple despite its low level approach:

import jax
import numpy as np
import bayex

def f(x):
    return -(1.4 - 3 * x) * np.sin(18 * x)

domain = {'x': bayex.domain.Real(0.0, 2.0)}
optimizer = bayex.Optimizer(domain=domain, maximize=True, acq='EI')

# Define some prior evaluations to initialise the GP.
params = {'x': [0.0, 0.5, 1.0]}
ys = [f(x) for x in params['x']]
opt_state = optimizer.init(ys, params)

# Sample new points using Jax PRNG approach.
ori_key = jax.random.key(42)
for step in range(50):
    key = jax.random.fold_in(ori_key, step)
    new_params = optimizer.sample(key, opt_state)
    y_new = f(**new_params)
    opt_state = optimizer.fit(opt_state, y_new, new_params)

with the results being saved at opt_state.best_params and opt_state.best_score.

Documentation

Available at https://bayex.readthedocs.io/en/latest.

License

Bayex is licensed under the MIT License. See the LICENSE file for more details.

Download files

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

Source Distribution

bayex-0.3.0.tar.gz (20.4 kB view details)

Uploaded Source

Built Distribution

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

bayex-0.3.0-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

Details for the file bayex-0.3.0.tar.gz.

File metadata

  • Download URL: bayex-0.3.0.tar.gz
  • Upload date:
  • Size: 20.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for bayex-0.3.0.tar.gz
Algorithm Hash digest
SHA256 557adfb95d8b7245c4c74526cb0a2385ced136b5291094b80be22689560473ae
MD5 76c50ff687fb1f88c55161b68a433bf3
BLAKE2b-256 2f6e595b89b8d9ac8e90446b45c485c5126c40287320b3cd314f8d38c439ebc2

See more details on using hashes here.

Provenance

The following attestation bundles were made for bayex-0.3.0.tar.gz:

Publisher: python-publish.yml on alonfnt/bayex

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bayex-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: bayex-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 13.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for bayex-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cbcc41be8c473e8dce2f434fe048b7f08e076f1f06b06a1ca500beb217bddabe
MD5 4a7a702393691e33b4ad6d21fd865eba
BLAKE2b-256 bd7afbfd4cb4d516625a8870d28388a29380280270c2a536b06d52143ff93f96

See more details on using hashes here.

Provenance

The following attestation bundles were made for bayex-0.3.0-py3-none-any.whl:

Publisher: python-publish.yml on alonfnt/bayex

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 files

0.2.2

2 files

0.2.0

2 files

0.1.1

2 files

0.1.0

2 files

Supported by

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