Getting 'NaN' in 'BestSoFar' column when using bayesopt()

4 Ansichten (letzte 30 Tage)
Feng Liu
Feng Liu am 6 Nov. 2023
Beantwortet: Avadhoot am 16 Nov. 2023
Hi, I am using bayesopt() to perform Bayesian Optimization with 32 parallel workers. However, the 'BestSoFar (observed)' column shows 'NaN' even after getting 'Accept' and 'Best' evaluation results. Also, the value ocassionally increased even though it is a minimization problem.
Here are two screenshots of the command window. The first one shows that the 'BestSoFar (observed)' column did not update its value even though the first feasible result appeared at the 13th iteration.
The second screenshot shows that the column still output some 'NaN' even after it got the 'Best' evaluation result, and the value in the column somehow increased a few iterations.
Does anyone know why bayesopt() act like this? Thanks!
Here is how I called the function:
numWorker = 32;
results = bayesopt(fun,vars,'NumCoupledConstraints', 3, ...
'IsObjectiveDeterministic',false, ...
'AreCoupledConstraintsDeterministic', [false, false, false], ...
'AcquisitionFunctionName','expected-improvement-plus', ...
'GPActiveSetSize',numWorker, ...
'UseParallel', true, ...
'MaxObjectiveEvaluations',numWorker*10, ...
'NumSeedPoints',numWorker*2);

Antworten (1)

Avadhoot
Avadhoot am 16 Nov. 2023
Hi Feng Liu,
I understand that you are using the "bayesopt" function for Bayesian optimization. It appears that you have set the "IsObjectiveDeterministic" parameter to false, indicating that your objective function is non-deterministic. Additionally, your coupled constraints are also non-deterministic. This introduces some level of noise into the model due to the non-deterministic nature of these functions. Based on these factors, I can provide some probable reasons for the results you are observing.
The "bayesopt" function follows the principle of exploration-exploitation tradeoff to find the optimal value of the objective function. As a result, it may sometimes accept a value that is higher than the current "BestSoFar" value in order to explore a new direction. Conversely, in some cases, it may not update the "BestSoFar" value even if the constraints are satisfied.
You mentioned encountering the issue of getting NaN in the "BestSoFar" column. This can occur if the algorithm has not yet found an optimal value for the objective function. The non-deterministic nature of the objective function further contributes to this uncertainty. If all the constraints have been satisfied and the value is still NaN, the exploration-exploitation tradeoff comes into play.
Refer to the documentation below to understand more about the "bayesopt" function and how it operates:
  1. bayesopt function: https://www.mathworks.com/help/stats/bayesopt.html#d126e159346
  2. Bayesian Optimization algorithm: https://www.mathworks.com/help/stats/bayesian-optimization-algorithm.html
I hope this helps.

Produkte


Version

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by