openturns / openturns

Uncertainty treatment library
http://openturns.github.io/openturns/latest/index.html
Other
230 stars 93 forks source link

EGO: make the ExpectedImprovementEvaluation accessible #1786

Open josephmure opened 3 years ago

josephmure commented 3 years ago

OpenTURNS users from the CEA have contacted us about a missing feature in the EfficientOptimizationAlgorithm class. They would like to evaluate the Expected Improvement criterion anywhere on their input space.

The library does have a class to do that, ExpectedImprovementEvaluation, but it is only instanciated inside EfficientOptimizationAlgorithm::run(): https://github.com/openturns/openturns/blob/38f8d45840d47b8a804665e6dd614a4603c78cd7/lib/src/Uncertainty/Algorithm/Optimization/EfficientGlobalOptimization.cxx#L267

Is it possible to create an accessor that would return this object?

As a workaround, @mbaudin47 has written a Python class to implement this functionality. You will find it at the bottom of this script.

mbaudin47 commented 3 years ago

The 15-minutes-prototype :) does not implement the noise in the criterion: this should be done so that we can have a full-featured prototype.

The script produces the following figures:

image

image

romainespoeys commented 3 years ago

Thanks to the script provided by @mbaudin47, I was able to implement in a simplified way an EGO algorithm, similar to the one given by the EfficientGlobalOptimization() function.

I am attaching this script, allowing me to plot the Expected Improvement for a given iteration on my computational domain, in order to fully understand how the EGO method works.

algo_EGO.txt fonction_calcul.txt

mbaudin47 commented 3 years ago

Thank you very much for sharing your script!

Notice that the current API does not provide a way to add a new point to an existing kriging: you have to create a brand new kriging at each iteration (adding this feature is in the roadmap). Please be aware of the scaling issue discussed at:

https://openturns.discourse.group/t/normalization-of-the-input-sample-in-krigingalgorithm-in-ot1-16/101

Your code may not require to scale the inputs, but this may be worth to know about.