Skip to content

Commit

Permalink
JOSS paper (#42)
Browse files Browse the repository at this point in the history
* Initial paper version

* Adjust SMT reference

* Fix affiliation

* Fix DOIs

* Review statement of need

* Add architecture figure

* Fix typo

* Fix examples doc section

* Absolute links for sub-packages

* Re-use README as crate doc

* Absolute link for tutorial
  • Loading branch information
relf authored Oct 7, 2022
1 parent 648d011 commit d31e12c
Show file tree
Hide file tree
Showing 7 changed files with 201 additions and 41 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,8 @@ python/egobox/egobox.pyd
*.npy
input.txt
output.txt
mopta08*
mopta08*

# JOSS
joss/paper.jats
joss/paper.pdf
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ Rust toolbox for Efficient Global Optimization algorithms inspired from [SMT](ht

`egobox` Rust libraries consists of the following sub-packages.

| Name | Version | Documentation | Description |
| :----------- | :---------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------- | :------------------------------------------------------------------------------ |
| [doe](./doe) | [![crates.io](https://img.shields.io/crates/v/egobox-doe)](https://crates.io/crates/egobox-doe) | [![docs](https://docs.rs/egobox-doe/badge.svg)](https://docs.rs/egobox-doe) | sampling methods; contains LHS, FullFactorial, Random methods |
| [gp](./gp) | [![crates.io](https://img.shields.io/crates/v/egobox-gp)](https://crates.io/crates/egobox-gp) | [![docs](https://docs.rs/egobox-gp/badge.svg)](https://docs.rs/egobox-gp) | gaussian process regression; contains Kriging and PLS dimension reduction |
| [moe](./gp) | [![crates.io](https://img.shields.io/crates/v/egobox-moe)](https://crates.io/crates/egobox-moe) | [![docs](https://docs.rs/egobox-moe/badge.svg)](https://docs.rs/egobox-moe) | mixture of experts using GP models |
| [ego](./ego) | [![crates.io](https://img.shields.io/crates/v/egobox-ego)](https://crates.io/crates/egobox-ego) | [![docs](https://docs.rs/egobox-ego/badge.svg)](https://docs.rs/egobox-ego) | efficient global optimization with basic constraints and mixed integer handling |
| Name | Version | Documentation | Description |
| :---------------------------------------------------- | :---------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------- | :------------------------------------------------------------------------------ |
| [doe](https://github.com/relf/egobox/tree/master/doe) | [![crates.io](https://img.shields.io/crates/v/egobox-doe)](https://crates.io/crates/egobox-doe) | [![docs](https://docs.rs/egobox-doe/badge.svg)](https://docs.rs/egobox-doe) | sampling methods; contains LHS, FullFactorial, Random methods |
| [gp](https://github.com/relf/egobox/tree/master/gp) | [![crates.io](https://img.shields.io/crates/v/egobox-gp)](https://crates.io/crates/egobox-gp) | [![docs](https://docs.rs/egobox-gp/badge.svg)](https://docs.rs/egobox-gp) | gaussian process regression; contains Kriging and PLS dimension reduction |
| [moe](https://github.com/relf/egobox/tree/master/moe) | [![crates.io](https://img.shields.io/crates/v/egobox-moe)](https://crates.io/crates/egobox-moe) | [![docs](https://docs.rs/egobox-moe/badge.svg)](https://docs.rs/egobox-moe) | mixture of experts using GP models |
| [ego](https://github.com/relf/egobox/tree/master/ego) | [![crates.io](https://img.shields.io/crates/v/egobox-ego)](https://crates.io/crates/egobox-ego) | [![docs](https://docs.rs/egobox-ego/badge.svg)](https://docs.rs/egobox-ego) | efficient global optimization with basic constraints and mixed integer handling |

### Usage

Expand Down Expand Up @@ -89,7 +89,7 @@ Thanks to the [PyO3 project](https://pyo3.rs), which makes Rust well suited for
$ pip install egobox
```

See the [tutorial notebook](doc/TutorialEgor.ipynb) for usage of the optimizer.
See the [tutorial notebook](https://github.com/relf/egobox/tree/master/doc/TutorialEgor.ipynb) for usage of the optimizer.

## Why egobox?

Expand Down
12 changes: 5 additions & 7 deletions ego/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! This library implements Efficient Global Optimization method,
//! it is a port of [SMT EGO algorithm](https://smt.readthedocs.io/en/latest/_src_docs/applications/ego.html)
//! it is a port of [SMT EGO algorithm](https://smt.readthedocs.io/en/stable/_src_docs/applications/ego.html)
//!
//! The optimizer is able to deal with inequality constraints.
//! Objective and contraints are expected to computed grouped at the same time
Expand All @@ -12,7 +12,7 @@
//! * parameterize mixture of experts,
//! * save intermediate results and allow hot restart,
//!
//! # Example
//! # Examples
//!
//! ```no_run
//! use ndarray::{array, Array2, ArrayView2};
Expand All @@ -35,10 +35,8 @@
//! While [Egor] optimizer works with continuous data (i.e floats), the class [MixintEgor]
//! allows to make basic mixed-integer optimization by decorating `Egor` class.
//!
//! Example
//!
//! We define an objective function `mixsinx` taking integer input values from the previous
//! function `xsinx` defined above and we optimize with MixintEgor.
//! As a second example, we define an objective function `mixsinx` taking integer
//! input values from the previous function `xsinx` defined above and we optimize with `MixintEgor`.
//!
//! ```no_run
//! use ndarray::{array, Array2, ArrayView2};
Expand Down Expand Up @@ -76,7 +74,7 @@
//! let mut mixintegor = MixintEgor::new(mixsinx, &surrogate_builder, &pre_proc);
//! let res = mixintegor
//! .egor
//! .doe(Some(doe)) // we pas an initial doe
//! .doe(Some(doe)) // we pass an initial doe
//! .n_eval(n_eval)
//! .infill_strategy(InfillStrategy::EI)
//! .minimize().unwrap();
Expand Down
Binary file added joss/egobox_architecture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
77 changes: 77 additions & 0 deletions joss/paper.bib
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
@article{Jones1998,
title={Efficient global optimization of expensive black-box functions},
author={Jones, Donald R and Schonlau, Matthias and Welch, William J},
journal={Journal of Global optimization},
volume={13},
number={4},
pages={455--492},
year={1998},
publisher={Springer}
}

@article{Bouhlel2016,
title={Improving kriging surrogates of high-dimensional design models by Partial Least Squares dimension reduction},
author={Bouhlel, Mohamed Amine and Bartoli, Nathalie and Otsmane, Abdelkader and Morlier, Joseph},
journal={Structural and Multidisciplinary Optimization},
volume={53},
number={5},
pages={935--952},
doi={10.1007/s00158-015-1395-9},
year={2016},
publisher={Springer},
}

@inproceedings{Bartoli2016,
title={Improvement of efficient global optimization with application to aircraft wing design},
author={Bartoli, Nathalie and Bouhlel, Mohamed-Amine and Kurek, Igor and Lafage, R{\'e}mi and Lefebvre, Thierry and Morlier, Joseph and Priem, R{\'e}my and Stilz, Vivien and Regis, Rommel},
booktitle={17th AIAA/ISSMO Multidisciplinary analysis and optimization conference},
pages={4001},
doi={10.2514/6.2016-4001},
year={2016},
}

@article{Bartoli2019,
title = {Adaptive modeling strategy for constrained global optimization with application to aerodynamic wing design},
journal = {Aerospace Science and Technology},
volume = {90},
pages = {85-102},
doi = {10.1016/j.ast.2019.03.041},
year = {2019},
issn = {1270-9638},
url = {https://www.sciencedirect.com/science/article/pii/S1270963818306011},
author = {N. Bartoli and T. Lefebvre and S. Dubreuil and R. Olivanti and R. Priem and N. Bons and J.R.R.A. Martins and J. Morlier},
keywords = {Surrogate modeling, Global optimization, Multimodal optimization, Mixture of experts, Aerodynamic shape optimization, Wing design},
abstract = {Surrogate models are often used to reduce the cost of design optimization problems that involve computationally costly models, such as computational fluid dynamics simulations. However, the number of evaluations required by surrogate models usually scales poorly with the number of design variables, and there is a need for both better constraint formulations and multimodal function handling. To address this issue, we developed a surrogate-based gradient-free optimization algorithm that can handle cases where the function evaluations are expensive, the computational budget is limited, the functions are multimodal, and the optimization problem includes nonlinear equality or inequality constraints. The proposed algorithm—super efficient global optimization coupled with mixture of experts (SEGOMOE)—can tackle complex constrained design optimization problems through the use of an enrichment strategy based on a mixture of experts coupled with adaptive surrogate models. The performance of this approach was evaluated for analytic constrained and unconstrained problems, as well as for a multimodal aerodynamic shape optimization problem with 17 design variables and an equality constraint. Our results showed that the method is efficient and that the optimum is much less dependent on the starting point than the conventional gradient-based optimization.}
}

@article{Dubreuil2020,
title={Towards an efficient global multidisciplinary design optimization algorithm},
author={Dubreuil, Sylvain and Bartoli, Nathalie and Gogu, Christian and Lefebvre, Thierry},
journal={Structural and Multidisciplinary Optimization},
volume={62},
number={4},
pages={1739--1765},
doi={10.1007/s00158-020-02514-6},
year={2020},
publisher={Springer}
}

@article{SMT2019,
author = {Mohamed Amine Bouhlel and John T. Hwang and Nathalie Bartoli and Rémi Lafage and Joseph Morlier and Joaquim R. R. A. Martins},
journal = {Advances in Engineering Software},
title = {A Python surrogate modeling framework with derivatives},
pages = {102662},
year = {2019},
issn = {0965-9978},
doi = {10.1016/j.advengsoft.2019.03.005},
year = {2019}
}

@misc{SMT2018,
author = SMTOrg,
title = {Surrogate Modeling Toolbox},
year = {2018},
publisher = {GitHub},
journal = {GitHub repository},
url = {https://github.com/SMTOrg/smt}
}
106 changes: 106 additions & 0 deletions joss/paper.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
---
title: 'egobox, a Rust toolbox for efficient global optimization'
tags:
- Rust
- design of experiments
- gaussian process
- mixture of experts
- surrogate-based optimization
authors:
- name: Rémi Lafage
orcid: 0000-0001-5479-2961
affiliation: 1
affiliations:
- name: ONERA, Université de Toulouse, France
index: 1
date: "29 March 2022"
bibliography: paper.bib
---

# Summary

Efficient global optimization (EGO) algorithms are used to tackle design optimization problems
that involve computationally costly models [@Jones1998]. Basically, the idea is to use gaussian
process regression to approximate the objective function and use probabilistic information
to select the promising next point where the optimum could be located.

Starting from that, one still has to tackle numerous challenges regarding the dimensionality,
multi-modality and computation time. Different algorithms may be develop to overcome
these hurdles [@Bartoli2019; @Dubreuil2020]. A key component of such surrogate-based algorithms
is the existence of an implementation of gaussian process regression also known as
kriging method [@Bouhlel2016].

The Surrogate Modeling Toolbox [@SMT2018; @SMT2019] library addresses such concerns using
the Python programming language. The `egobox` library provides such key component to the Rust
machine-learning community while focusing on adaptative global optimization.

# Statement of need

Started by porting relevant parts from the SMT library in Rust, the `egobox` library aims
at providing building blocks useful to implement EGO-like algorithms. This open source library
will be used by research engineers needing to tackle design optimization problems using a
surrogate-based adaptative approach while taking advantage of the Rust programming
language.

Indeed research scientists reach for prototyping programming language such as Python to develop
new methods. Thanks to performant easy-to-use libraries like `numpy`, `scipy`, `scikit-learn`
the Python language has become popular in science computing. The ability of Python
to glue together different codes explains Python ecosystem is now a de-facto open source
standard for scientific software. Nevertheless, one might notice that the performances
of above Python libraries relies extensively on C/Fortran compiled code.

Thus, in the long run, a language like Python well-suited for prototyping may not be
suitable for maintainability or performance even with a strong software development discipline.
Performance issues may arise as new algorithms are built on top of the others
which at some point may not be tractable with such interpreted programming language.
As stated above, it is common to resort to compiled languages like C/C++ or Fortran
to implement computation-intensive methods or for embeding them in more constrained
environments where a Python runtime does not fit.

# Library features

With the above need in mind, the Rust programming language appears to be of interest
with its selling points being performance, reliability and productivity.
The language is meant to challenge C as a system language but also rely on strong typing,
and high level features such as functional programming, algebric data types, module
management. It has a strict approach regarding memory-safety management and
benefits from a state of the art tooling for software development.

The Rust community has developed scientific libraries like `ndarray`, `ndarray-linalg`
which can be seen as the `numpy` and `scipy` Rust counterparts. Last but not least,
the `linfa` project addresses the machine-learning domain with the purpose of being
the Rust equivalent of `scikit-learn`.

The `egobox` library relies on the above thriving Rust machine learning ecosystem and
focuses on providing some building blocks to implement efficient global optimization
algorithms. The library is organized in four sub-packages as follows:

* `doe`: sampling methods implementing Latin Hypercube sampling, popular sampling
method used to create design of experiments,

* `gp`: gaussian process regression also known as kriging algorithm used
as surrogate models for computationally costly black-box functions,

* `moe`: mixture of experts which aims at increasing the accuracy of a surrogate
approximation by clustering the design space, training and selecting the best
surrogate models on each cluster,

* `ego`: an efficient global optimization implementation with handling of inequality
constraints and mixed integer optimization through continuous relaxation.

![Architecture of the library](egobox_architecture.png)

Finally thanks to the `PyO3` project, the Rust language is well-suited to create
Python extensions which benefits from Rust strenghts while being integrated in the
Python ecosystem.

In order to increase the dissemination among the scientific community and demonstrate
actual optimization capabilities based on the library, we implemented a Python module `egobox`
as the binding of the implemented EGO-like Rust optimizer, namely `Egor`.

# Acknowledgements

I would like to thank my colleagues Nathalie Bartoli, Thierry Lefebvre and Sylvain Dubreuil
as their work on surrogate-based adaptative optimization has fueled this software development.

# References
27 changes: 1 addition & 26 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,29 +1,4 @@
//! `egobox`, Rust toolbox for efficient global optimization
//!
//! # For Rust developers
//!
//! `egobox` is a set of ML libraries.
//!
//! | Name | Version | Documentation | Description |
//! | :------------ | :---------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------- | :------------------------------------------------------------------------------ |
//! | `doe` | [![crates.io](https://img.shields.io/crates/v/egobox-doe)](https://crates.io/crates/egobox-doe) | [![docs](https://docs.rs/egobox-doe/badge.svg)](https://docs.rs/egobox-doe) | sampling methods; contains LHS, FullFactorial, Random methods |
//! | `gp` | [![crates.io](https://img.shields.io/crates/v/egobox-gp)](https://crates.io/crates/egobox-gp) | [![docs](https://docs.rs/egobox-gp/badge.svg)](https://docs.rs/egobox-gp) | gaussian process regression; contains Kriging and PLS dimension reduction |
//! | `moe` | [![crates.io](https://img.shields.io/crates/v/egobox-moe)](https://crates.io/crates/egobox-moe) | [![docs](https://docs.rs/egobox-moe/badge.svg)](https://docs.rs/egobox-moe) | mixture of experts using GP models |
//! | `ego` | [![crates.io](https://img.shields.io/crates/v/egobox-ego)](https://crates.io/crates/egobox-ego) | [![docs](https://docs.rs/egobox-ego/badge.svg)](https://docs.rs/egobox-ego) | efficient global optimization with basic constraints and mixed integer handling |
//!
//! # For Python users
//!
//! Thanks to the [PyO3 project](https://pyo3.rs), which makes Rust well suited for building Python extensions,
//! the EGO algorithm written in Rust (aka `egor`) is binded in Python (the present Rust `egobox` module).
//!
//! You can install the Python package using:
//!
//! ```bash
//! pip install egobox
//! ```
//!
//! See the [tutorial notebook](https://github.com/relf/egobox/doc/TutorialEgor.ipynb) for usage.
//!
#![doc = include_str!("../README.md")]

use egobox_doe::SamplingMethod;
use linfa::ParamGuard;
Expand Down

0 comments on commit d31e12c

Please sign in to comment.