Skip to main content

Anneal

Anneal

Start here. Bound-constrained global optimization with a single budget knob, or classical simulated-annealing presets you can swap without rewriting a driver.

Simulated-annealing components on the eindir typed primitives. One surface, many drivers: classical presets, Bayesian pilot+mixer, generalized Langevin equation (GLE) colored noise, rank-1 additive independence, quasi-Monte Carlo (QMC) polish, device/ensemble scale. All obey the same five-component algebra (Obj / Cool / Neigh / Move / Accept) and four composition laws checked at construction.

Docs https://anneal.rgoswami.me
License MIT
Software DOI https://zenodo.org/doi/10.5281/zenodo.10672746
Paper reproducibility https://github.com/HaoZeke/anneal_repro — Zenodo 10.5281/zenodo.20672621
History Continuous development since 2023-02 (see git log); multi-author CITATION.cff

Install

pip install anneal

Full stack (pinned Rust + Python + docs):

pixi install

Start here (budget-only portfolio)

The intended stand-alone tool for most users: pass an objective, box bounds, and a work-unit budget (objective and gradient evaluations share the counter).

import numpy as np
from anneal import global_optimize

def rastrigin(x):
    return 10.0 * len(x) + np.sum(x * x - 10.0 * np.cos(2.0 * np.pi * x))

low, high = np.full(5, -5.0), np.full(5, 5.0)
out = global_optimize(rastrigin, low, high, budget=4000, seed=0)
print(out["best_val"], out["best_pos"])

Runnable copies:

Classical presets (same driver, different slots)

from anneal import Boltzmann, Fast, Gsa, run

h = run(rastrigin, low, high, Boltzmann(t_init=5.0, sigma=0.5),
        n_epochs=40, steps_per_epoch=50, seed=1)
print(h.best_val)

Optional arms (additive independence + QMC polish)

import numpy as np
from anneal import additive_independence, qmc_polish

def rastrigin(x):
    return 10.0 * len(x) + np.sum(x*x - 10.0 * np.cos(2.0 * np.pi * x))

def grad_rastrigin(x):
    return 2.0 * x + 20.0 * np.pi * np.sin(2.0 * np.pi * x)

low = np.full(5, -5.0)
high = np.full(5, 5.0)

# Values-only rank-1 independence (no gradient)
res = additive_independence(rastrigin, low, high, max_fevals=3000, seed=7)

# Polish with gradient
refined = qmc_polish(rastrigin, grad_rastrigin, low, high,
                     n_starts=32, max_fevals_per_start=50, seed=0, top_k=1)
print(refined["best_val"])

Full docs, tutorials (classical, Bayesian pilot+mixer, GLE, polish+device), algebra, how-tos, and reference at https://anneal.rgoswami.me .

Development

pixi install
pixi run -e python python-test
pixi run -e docs docs-export
pixi run -e docs docs-build

See pixi.toml and docs/export.el (modeled on rgpycrumbs/rsx-rs patterns).

License and citation

MIT (see LICENSE.txt). Citation: CITATION.cff or the software Zenodo DOI. Multi-author software citation lists six authors. Project history since February 2023. Reproducibility package for paper tables and figures: HaoZeke/anneal_repro (Zenodo 10.5281/zenodo.20672621).

Download files

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

Source Distribution

anneal-0.7.0.tar.gz (3.5 MB view details)

Uploaded Source

Built Distributions

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

anneal-0.7.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64

anneal-0.7.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (964.0 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

anneal-0.7.0-cp310-abi3-macosx_11_0_arm64.whl (900.6 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

anneal-0.7.0-cp310-abi3-macosx_10_12_x86_64.whl (971.7 kB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

Details for the file anneal-0.7.0.tar.gz.

File metadata

  • Download URL: anneal-0.7.0.tar.gz
  • Upload date:
  • Size: 3.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for anneal-0.7.0.tar.gz
Algorithm Hash digest
SHA256 09e13c0eda230712202a28ffc10dc3cb00dcedd3c2d8852bbc86a92124acbb7f
MD5 2ab1db8d20797e6f02030c80c7929729
BLAKE2b-256 766ffacd299b7598435c04fd8f6423ef1c8805148805c3a589ef034e51e8ddaa

See more details on using hashes here.

Provenance

The following attestation bundles were made for anneal-0.7.0.tar.gz:

Publisher: release.yml on HaoZeke/anneal

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

File details

Details for the file anneal-0.7.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for anneal-0.7.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 383da19ef1fb545cfdc1e3b143149a1737d31861599060df27ff54024a59588b
MD5 225d9c8c4143179b55ee5074cff98c3f
BLAKE2b-256 685a9ebf91f331887f071d3440538ae24e71cdaa2adcd2d0de3fa3c08c9215e3

See more details on using hashes here.

Provenance

The following attestation bundles were made for anneal-0.7.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on HaoZeke/anneal

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

File details

Details for the file anneal-0.7.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for anneal-0.7.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 7cafd704af0d86bae0b02059ea851bc2219751b53bca66dffbd7e0058c3a3ef2
MD5 361446f591cdd4b07f50012276f7d978
BLAKE2b-256 a3ab1f15679681971eb7ce2c265b1472dfa97cb2dd0f06bce525fd3af1a440ae

See more details on using hashes here.

Provenance

The following attestation bundles were made for anneal-0.7.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on HaoZeke/anneal

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

File details

Details for the file anneal-0.7.0-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for anneal-0.7.0-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d8930dcb996be546eeef4f8e238482f5e24caaaec37090facaf73d4363b168d1
MD5 23f6ee043f7df31c0a96e9292e297004
BLAKE2b-256 f116b275d9c4c75bd6851b61afcc3a0ca22c689f3b00f27971dc9363dd41e4a2

See more details on using hashes here.

Provenance

The following attestation bundles were made for anneal-0.7.0-cp310-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on HaoZeke/anneal

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

File details

Details for the file anneal-0.7.0-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for anneal-0.7.0-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 93ad8b5fb7c2b24eb9a43ad978a3cc2fab39af1a9349b8da9e87bf28f4507b48
MD5 fa960432ada0fb25ed7cbb5437685ba8
BLAKE2b-256 28ac5cc02886db91d2660cf5dc1d444177d389dc5111878213bae2952d44bb01

See more details on using hashes here.

Provenance

The following attestation bundles were made for anneal-0.7.0-cp310-abi3-macosx_10_12_x86_64.whl:

Publisher: release.yml on HaoZeke/anneal

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

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