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.

Metadata

Release files for bayex 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bayex 0.3.0
File Size Uploaded
bayex-0.3.0.tar.gz 20.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bayex 0.3.0
File Interpreter ABI Platform
bayex-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 34.1 kB

Release files / bayex-0.3.0.tar.gz

Download URL bayex-0.3.0.tar.gz
Size 20.4 kB
Tags Source
SHA-256 checksum
How to use checksums
557adfb95d8b7245c4c74526cb0a2385ced136b5291094b80be22689560473ae
BLAKE2b-256 checksum
How to use checksums
2f6e595b89b8d9ac8e90446b45c485c5126c40287320b3cd314f8d38c439ebc2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 8, 2026.

Transparency log

Release files / bayex-0.3.0-py3-none-any.whl

Download URL bayex-0.3.0-py3-none-any.whl
Size 13.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cbcc41be8c473e8dce2f434fe048b7f08e076f1f06b06a1ca500beb217bddabe
BLAKE2b-256 checksum
How to use checksums
bd7afbfd4cb4d516625a8870d28388a29380280270c2a536b06d52143ff93f96
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 8, 2026.

Transparency log
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page