# EGO and infill criteria

**URL:** <https://openturns.discourse.group/t/ego-and-infill-criteria/399>\
**Category:** Development\
**Created:** [November 22, 2024, 10:37am UTC](https://openturns.discourse.group/t/ego-and-infill-criteria/399 "2024-11-22T10:37:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sofianehaddad](https://yyz2.discourse-cdn.com/free1/user_avatar/openturns.discourse.group/sofianehaddad/32/46_2.png) [@sofianehaddad](https://openturns.discourse.group/u/sofianehaddad)\
**Post date:** [November 22, 2024, 10:37am UTC](https://openturns.discourse.group/t/ego-and-infill-criteria/399/1 "2024-11-22T10:37:35Z")

</div>

Hi all,

Sometimes ago, we had a presentation from @l-brevault and @m-balesdent on benchmarking various infill criteria for bayesian optimization. This rich benchmark made a comparison between `6` criteria that are defined hereafter

– Expected Improvement (EI) [J. Močkus 1975, D. Jones et al. 1998] → the one used currently  
– Lower Confidence Bound (LCB) [Cox et al 1992]  
– Probability of Improvement (PI) [H. Kushner, 1964]  
– Watson and Barnes 2nd (WB2) [A. Watson et al. 1995]  
– Scaled Watson and Barnes 2nd (WB2S) [Bartoli et al. 2019]  
– Thompson sampling [W. Thompson, 1933]  
– Max-value Entropy Search (MES) [Wang et al. 2017]

The benchmark has been done on different use-cases of various complexity, with different dimension and computations budget.  
– Ackley : 2D  
– Branin : 2D  
– Three Hump Camel : 2D  
– Colville : 4D  
– Trid : 5D  
– Styblinski-Tang : 6D  
– Schwefell : 10D

Today the `expeced improvement` is hard-coded in the `API`. Thus the suggestion is to allow having more `infill criteria` and potentially having a user-defined one!

`What should be an infill criterion ?`

An infill criterion ([today](https://github.com/openturns/openturns/blob/master/lib/src/Uncertainty/Algorithm/Optimization/EfficientGlobalOptimization.cxx#L71)) is a `specific evaluation` that has the `() operator` But we should pay attention that the `infill` is updated during the [optimization process](https://github.com/openturns/openturns/blob/master/lib/src/Uncertainty/Algorithm/Optimization/EfficientGlobalOptimization.cxx#L239)

**Suggestion**

- Implement an `InfillCriterion` class that inherits from `EvaluationImplementation`
- `InfillCriterion` ctor → `InfillCriterion(krigingResult, optimalValue, isMinimization, hasNoise)`
- The class should allow to update both `optimalValue` and `KrigingResult` via `setters`
- Implement current ones (`ExpectedImprovement`, `AugmentedExpectedImprovement` that inherit from `InfillCriterion`)
- Implement the ones identified from the benchmark

what do you think ?

---

<div class="post-metadata">

**Author:** ![schueller](https://yyz2.discourse-cdn.com/free1/user_avatar/openturns.discourse.group/schueller/32/3_2.png) [@schueller](https://openturns.discourse.group/u/schueller)\
**Post date:** [November 25, 2024, 2:22pm UTC](https://openturns.discourse.group/t/ego-and-infill-criteria/399/2 "2024-11-25T14:22:33Z")

</div>

sounds ok, inheriting Evaluation makes senses since we want to make the function to the user

---

<div class="post-metadata">

**Author:** ![mdelozzo](https://yyz2.discourse-cdn.com/free1/user_avatar/openturns.discourse.group/mdelozzo/32/384_2.png) [@mdelozzo](https://openturns.discourse.group/u/mdelozzo)\
**Post date:** [November 26, 2024, 9:16pm UTC](https://openturns.discourse.group/t/ego-and-infill-criteria/399/3 "2024-11-26T21:16:10Z")

</div>

It would be great to find them in OT. And your implémentation makes sense. It would be also a good thing to add classical acquisition criteria for the estimation of level sets, quantiles and probabilities. And perhaps with parallel acquisition option. We developed a few things about active learning in [gemseo-mlearning](https://gemseo.gitlab.io/dev/gemseo-mlearning/latest/user_guide/active_learning/what_active_learning_is/), with examples based on the OT Kriging. Do not hesitate to have a look and see if the design can help you. Trieste can also be a source of inspiration.

---

<div class="post-metadata">

**Author:** ![sofianehaddad](https://yyz2.discourse-cdn.com/free1/user_avatar/openturns.discourse.group/sofianehaddad/32/46_2.png) [@sofianehaddad](https://openturns.discourse.group/u/sofianehaddad)\
**Post date:** [November 28, 2024, 10:21am UTC](https://openturns.discourse.group/t/ego-and-infill-criteria/399/4 "2024-11-28T10:21:03Z")

</div>

Thanks for the inputs, I will have a look at your designs in `gemseo`.  
I was aware about `Trieste` and the various infill. The problem today is more in terms of usability.

I will try to prepare something for the next technical committee
