egobox, a Rust toolbox for efficient global optimization
egobox, a Rust toolbox for efficient global optimization - Published in JOSS (2022)
Science Score: 93.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 21 DOI reference(s) in README and JOSS metadata -
✓Academic publication links
Links to: arxiv.org, researchgate.net, springer.com, joss.theoj.org -
○Committers with academic emails
-
○Institutional organization owner
-
✓JOSS paper metadata
Published in Journal of Open Source Software
Keywords
Keywords from Contributors
Scientific Fields
Repository
Efficient global optimization toolbox in Rust: bayesian optimization, mixture of gaussian processes, sampling methods
Basic Info
- Host: GitHub
- Owner: relf
- License: apache-2.0
- Language: Rust
- Default Branch: master
- Homepage: https://joss.theoj.org/papers/10.21105/joss.04737
- Size: 15.5 MB
Statistics
- Stars: 133
- Watchers: 3
- Forks: 9
- Open Issues: 14
- Releases: 48
Topics
Metadata Files
README.md
EGObox - Efficient Global Optimization toolbox
Rust toolbox for Efficient Global Optimization method (arguably the most well-known bayesian optimization algorithm) which adresses the gradient-free optimization of expensive objective functions.
The egobox package is twofold:
- for end-users: a Python module, the Python binding of the optimizer named
Egorand the surrogate modelGpx, mixture of Gaussian processes, written in Rust. - for developers: a set of Rust libraries useful to implement bayesian optimization (EGO-like) algorithms,
The Python module
Installation
bash
pip install egobox
Egor optimizer
```python import numpy as np import egobox as egx
Objective function
def f_obj(x: np.ndarray) -> np.ndarray: return (x - 3.5) * np.sin((x - 3.5) / (np.pi))
Minimize f_opt in [0, 25]
res = egx.Egor([[0.0, 25.0]], seed=42).minimize(fobj, maxiters=20) print(f"Optimization f={res.yopt} at {res.xopt}") # Optimization f=[-15.12510323] at [18.93525454] ```
See also this example written in Rust
Gpx surrogate model
```python import numpy as np import matplotlib.pyplot as plt import egobox as egx
Training
xtrain = np.array([0.0, 1.0, 2.0, 3.0, 4.0]) ytrain = np.array([0.0, 1.0, 1.5, 0.9, 1.0]) gpx = egx.Gpx.builder().fit(xtrain, ytrain)
Prediction
xtest = np.linspace(0, 4, 100).reshape((-1, 1)) ytest = gpx.predict(xtest)
Plot
plt.plot(xtest, ytest) plt.plot(xtrain, ytrain, "o") plt.show() ```
See also this example written in Rust
See the tutorial notebooks and examples folder for more information on the usage of the optimizer and mixture of Gaussian processes surrogate model.
The Rust libraries
egobox Rust libraries consists of the following sub-packages.
| Name | Version | Documentation | Description |
| :---------------------------------------------------- | :---------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------- |
| doe | |
| sampling methods; contains LHS, FullFactorial, Random methods |
| gp |
|
| gaussian process regression; contains Kriging, PLS dimension reduction and sparse methods |
| moe |
|
| mixture of experts using GP models |
| ego |
|
| efficient global optimization with constraints and mixed integer handling |
Usage
Depending on the sub-packages you want to use, you have to add following declarations to your Cargo.toml
text
[dependencies]
egobox-doe = { version = "0.32" }
egobox-gp = { version = "0.32" }
egobox-moe = { version = "0.32" }
egobox-ego = { version = "0.32" }
Features
The table below presents the various features available depending on the subcrate
| Name | doe | gp | moe | ego | | :----------- | :--- | :--- | :--- | :--- | | serializable | ✔️ | ✔️ | ✔️ | | | persistent | | | ✔️ | ✔️(*) | | blas | | ✔️ | ✔️ | ✔️ | | nlopt | | ✔️ | | ✔️ |
(*) for persistent mixture of gaussian processes with discrete variable available in ego
serializable
When selected, the serialization with serde crate is enabled.
persistent
When selected, the save and load as a json file with serde_json crate is enabled.
blas
When selected, the usage of BLAS/LAPACK backend is possible, see below for more information.
nlopt
When selected, the nlopt crate is used to provide optimizer implementations (ie Cobyla, Slsqp)
Examples
Examples (in examples/ sub-packages folder) are run as follows:
bash
cd doe && cargo run --example samplings --release
bash
cd gp && cargo run --example kriging --release
bash
cd moe && cargo run --example clustering --release
bash
cd ego && cargo run --example ackley --release
BLAS/LAPACK backend (optional)
egobox relies on linfa project for methods like clustering and dimension reduction, but also try to adopt as far as possible the same coding structures.
As for linfa, the linear algebra routines used in gp, moe ad ego are provided by the pure-Rust linfa-linalg crate, the default linear algebra provider.
Otherwise, you can choose an external BLAS/LAPACK backend available through the ndarray-linalg crate. In this case, you have to specify the blas feature and a linfa BLAS/LAPACK backend feature (more information in linfa features).
Thus, for instance, to use gp with the Intel MKL BLAS/LAPACK backend, you could specify in your Cargo.toml the following features:
text
[dependencies]
egobox-gp = { version = "0.32", features = ["blas", "linfa/intel-mkl-static"] }
or you could run the gp example as follows:
bash
cd gp && cargo run --example kriging --release --features blas,linfa/intel-mkl-static
Citation
If you find this project useful for your research, you may cite it as follows:
text
@article{
Lafage2022,
author = {Rémi Lafage},
title = {egobox, a Rust toolbox for efficient global optimization},
journal = {Journal of Open Source Software}
year = {2022},
doi = {10.21105/joss.04737},
url = {https://doi.org/10.21105/joss.04737},
publisher = {The Open Journal},
volume = {7},
number = {78},
pages = {4737},
}
Additionally, you may consider adding a star to the repository. This positive feedback improves the visibility of the project.
References
Bartoli, N., Lefebvre, T., Dubreuil, S., Olivanti, R., Priem, R., Bons, N., Martins, J. R. R. A., & Morlier, J. (2019). Adaptive modeling strategy for constrained global optimization with application to aerodynamic wing design. Aerospace Science and Technology, 90, 85–102.
Bouhlel, M. A., Bartoli, N., Otsmane, A., & Morlier, J. (2016). Improving kriging surrogates of high-dimensional design models by partial least squares dimension reduction. Structural and Multidisciplinary Optimization, 53(5), 935–952.
Bouhlel, M. A., Hwang, J. T., Bartoli, N., Lafage, R., Morlier, J., & Martins, J. R. R. A. (2019). A python surrogate modeling framework with derivatives. Advances in Engineering Software, 102662.
Dubreuil, S., Bartoli, N., Gogu, C., & Lefebvre, T. (2020). Towards an efficient global multi-disciplinary design optimization algorithm Structural and Multidisciplinary Optimization, 62(4), 1739–1765.
Jones, D. R., Schonlau, M., & Welch, W. J. (1998). Efficient global optimization of expensive black-box functions. Journal of Global Optimization, 13(4), 455–492.
Diouane, Youssef, et al. TREGO: a trust-region framework for efficient global optimization. Journal of Global Optimization 86.1 (2023): 1-23.
Priem, Rémy, Nathalie Bartoli, and Youssef Diouane. On the use of upper trust bounds in constrained Bayesian optimization infill criteria. AIAA aviation 2019 forum. 2019.
Sasena M., Papalambros P., Goovaerts P., 2002. Global optimization of problems with disconnected feasible regions via surrogate modeling. AIAA Paper.
Ginsbourger, D., Le Riche, R., & Carraro, L. (2010). Kriging is well-suited to parallelize optimization
E.C. Garrido-Merchan and D. Hernandez-Lobato. Dealing with categorical and integer-valued variables in Bayesian Optimization with Gaussian processes.
Zhan, Dawei, et al. A cooperative approach to efficient global optimization. Journal of Global Optimization 88.2 (2024): 327-357
Lisa Pretsch et al. Bayesian optimization of cooperative components for multi-stage aero-structural compressor blade design. Struct Multidisc Optim 68, 84 (2025)
Appriou, T., Rullière, D. & Gaudrie, D, Combination of optimization-free kriging models for high-dimensional problems, Comput Stat 39, 3049–3071 (2024).
S Ament, S Daulton, D Eriksson, M Balandat, E Bakshy, Unexpected improvements to expected improvement for bayesian optimization, Advances in Neural Information Processing Systems, 2023
smtorg. (2018). Surrogate modeling toolbox. GitHub.
License
Licensed under the Apache License, Version 2.0 http://www.apache.org/licenses/LICENSE-2.0
Owner
- Name: Rémi Lafage
- Login: relf
- Kind: user
- Location: Toulouse, France
- Company: ONERA
- Repositories: 27
- Profile: https://github.com/relf
Research engineer at ONERA, working on tools related to multi-disciplinary optimization for overall vehicle design.
JOSS Publication
egobox, a Rust toolbox for efficient global optimization
Tags
design of experiments gaussian process mixture of experts surrogate-based optimizationGitHub Events
Total
- Create event: 63
- Release event: 12
- Issues event: 18
- Watch event: 64
- Delete event: 58
- Issue comment event: 53
- Push event: 232
- Pull request review comment event: 9
- Pull request review event: 10
- Pull request event: 112
- Fork event: 6
Last Year
- Create event: 63
- Release event: 12
- Issues event: 18
- Watch event: 64
- Delete event: 58
- Issue comment event: 53
- Push event: 232
- Pull request review comment event: 9
- Pull request review event: 10
- Pull request event: 112
- Fork event: 6
Committers
Last synced: 5 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| relf | r****e@o****r | 572 |
| dependabot[bot] | 4****] | 6 |
| jomorlier | j****r@i****r | 1 |
| Jusong Yu | j****u@g****m | 1 |
| Jonas Pleyer | 5****r | 1 |
| Arfon Smith | a****n | 1 |
Issues and Pull Requests
Last synced: 4 months ago
All Time
- Total issues: 31
- Total pull requests: 369
- Average time to close issues: about 1 month
- Average time to close pull requests: 4 days
- Total issue authors: 14
- Total pull request authors: 8
- Average comments per issue: 2.55
- Average comments per pull request: 0.16
- Merged pull requests: 302
- Bot issues: 2
- Bot pull requests: 54
Past Year
- Issues: 14
- Pull requests: 149
- Average time to close issues: 22 days
- Average time to close pull requests: 4 days
- Issue authors: 6
- Pull request authors: 7
- Average comments per issue: 2.64
- Average comments per pull request: 0.26
- Merged pull requests: 107
- Bot issues: 1
- Bot pull requests: 29
Top Authors
Issue Authors
- relf (13)
- unkcpz (4)
- jonaspleyer (2)
- dependabot[bot] (2)
- YuhanLiin (1)
- wangjiawen2013 (1)
- Zcaic (1)
- kyle-messier (1)
- s4ksb (1)
- quietlychris (1)
- brurucy (1)
- schliffen (1)
- janroden (1)
- bytesnake (1)
Pull Request Authors
- relf (303)
- dependabot[bot] (54)
- unkcpz (3)
- jomorlier (2)
- zao111222333 (2)
- Mayousk (2)
- jonaspleyer (2)
- arfon (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 6
-
Total downloads:
- cargo 218,376 total
- pypi 7,213 last-month
-
Total dependent packages: 13
(may contain duplicates) -
Total dependent repositories: 5
(may contain duplicates) - Total versions: 261
- Total maintainers: 2
pypi.org: egobox
- Homepage: https://github.com/relf/egobox
- Documentation: https://egobox.readthedocs.io/
- License: Apache Software License
-
Latest release: 0.32.0
published 5 months ago
Rankings
Maintainers (1)
crates.io: egobox-doe
A library for design of experiments
- Homepage: https://github.com/relf/egobox
- Documentation: https://docs.rs/egobox-doe/
- License: Apache-2.0
-
Latest release: 0.32.0
published 5 months ago
Rankings
Maintainers (1)
crates.io: egobox-gp
A library for gaussian process modeling
- Homepage: https://github.com/relf/egobox
- Documentation: https://docs.rs/egobox-gp/
- License: Apache-2.0
-
Latest release: 0.32.0
published 5 months ago
Rankings
Maintainers (1)
crates.io: egobox-moe
A library for mixture of expert gaussian processes
- Homepage: https://github.com/relf/egobox
- Documentation: https://docs.rs/egobox-moe/
- License: Apache-2.0
-
Latest release: 0.32.0
published 5 months ago
Rankings
Maintainers (1)
crates.io: egobox-ego
A library for efficient global optimization
- Homepage: https://github.com/relf/egobox
- Documentation: https://docs.rs/egobox-ego/
- License: Apache-2.0
-
Latest release: 0.32.0
published 5 months ago
Rankings
Maintainers (1)
crates.io: egobox
A python binding for egobox crates
- Homepage: https://github.com/relf/egobox
- Documentation: https://docs.rs/egobox/
- License: Apache-2.0
-
Latest release: 0.32.0
published 5 months ago
Rankings
Maintainers (1)
Dependencies
- anyhow =1.0.48
- egobox-doe 0.3.0
- egobox-ego 0.3.0
- egobox-gp 0.3.0
- egobox-moe 0.3.0
- env_logger 0.9
- finitediff 0.1
- libm 0.2
- linfa 0.6.0
- log 0.4
- ndarray 0.15
- ndarray-rand 0.14
- numpy 0.15.0
- pyo3 0.15.1
- pyo3-log 0.5.0
- rand_isaac 0.3
- linfa 0.6.0
- ndarray 0.15
- ndarray-rand 0.14
- ndarray-stats 0.5
- num-traits 0.2
- rand_isaac 0.3
- egobox-doe 0.3.0
- egobox-gp 0.3.0
- egobox-moe 0.3.0
- env_logger 0.9
- finitediff 0.1
- libm 0.2
- linfa 0.6.0
- linfa-linalg 0.1
- linfa-pls 0.6.0
- log 0.4
- ndarray 0.15
- ndarray-linalg 0.14
- ndarray-npy 0.8
- ndarray-rand 0.14
- ndarray-stats 0.5
- nlopt 0.5.3
- rand_isaac 0.3
- rawpointer 0.2
- serde 1
- serde_json 1
- thiserror 1
- typetag 0.1
- cobyla 0.1.2
- egobox-doe 0.3.0
- linfa 0.6.0
- linfa-linalg 0.1
- linfa-pls 0.6.0
- ndarray 0.15
- ndarray-linalg 0.14
- ndarray-npy 0.8
- ndarray-rand 0.14
- ndarray-stats 0.5
- ndarray_einsum_beta 0.7
- nlopt 0.5.3
- num-traits 0.2
- paste 1.0
- rand_isaac 0.3
- serde 1.0
- thiserror 1
- bitflags 1.3
- egobox-doe 0.3.0
- egobox-gp 0.3.0
- env_logger 0.9
- linfa 0.6.0
- linfa-clustering 0.6.0
- linfa-linalg 0.1
- linfa-pls 0.6.0
- log 0.4
- ndarray 0.15
- ndarray-linalg 0.14
- ndarray-npy 0.8
- ndarray-rand 0.14
- ndarray-stats 0.5
- paste 1.0
- rand_isaac 0.3
- serde 1
- serde_json 1
- thiserror 1
- typetag 0.1
- pytest ^6.2 develop
- numpy >=1.18
- python >=3.7
- actions-rs/cargo v1 composite
- actions-rs/toolchain v1 composite
- actions/checkout v2 composite
- KyleMayes/install-llvm-action v1 composite
- actions-rs/toolchain v1 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- KyleMayes/install-llvm-action v1 composite
- actions-rs/cargo v1 composite
- actions-rs/toolchain v1 composite
- actions/checkout v2 composite
- maturin latest build
