# Parallel bayesopt: what is the relationship between the number of iterations and number of workers?

1 vue (au cours des 30 derniers jours)
Simon Stone le 18 Déc 2019
Commenté : Simon Stone le 24 Déc 2019
I am having a hard time wrapping my head around how exactly parallel Bayes optimization works in Matlab. Maybe someone can help me out with this:
Regular Bayes optimization evaluates a number of parameter combinations equal to the number of iterations: at every iteration one combination is used, the internal GP model is updated, the new parameter combination is determined, and a new iteration begins.
In parallel Bayes optimization, the documentation says "bayesopt assigns points to evaluate to the parallel workers, generally one point at a time". So by my understanding, if I had 5 workers and 10 iterations I could evaluate the same number of parameter combinations as in non-parallel bayesopt (so 1 worker) and 50 iterations. I understand that there are some differences between those approaches in terms of which point is chosen next and so on, but in principle this is correct, right?
So with this understanding, I don't know how to interpret this output:
|==============================================================================================================================|
| Iter | Active | Eval | Objective | Objective | BestSoFar | BestSoFar | win_length | window | Pmin |
| | workers | result | | runtime | (observed) | (estim.) | | | |
|==============================================================================================================================|
| 1 | 24 | Best | 496.42 | 736.15 | 496.42 | 496.42 | 32 | kaiser(3) | 25 |
| 2 | 24 | Best | 410.36 | 4913.8 | 410.36 | 413.78 | 32 | hann | 96 |
| 3 | 24 | Best | 322.27 | 6739.4 | 322.27 | 408.17 | 64 | kaiser(12) | 20 |
At every iteration, 24 workers are active. Are 24 points evaluated? Are the reported parameter values then only the best ones from that batch? Which ones were attempted?
Any help to understand this would be greatly appreciated.
##### 0 commentairesAfficher -2 commentaires plus anciensMasquer -2 commentaires plus anciens

Connectez-vous pour commenter.

### Réponse acceptée

Don Mathis le 23 Déc 2019
For parallel bayesopt, the first column shown is actually the function evaluation number. It's not exactly right to call it an iteration.
The algorithm runs jobs (function evaluations) asynchronously in parallel using the parfeval function. Jobs take different amounts of time, and when a job finishes, it is replaced with a new one, while the other jobs continue running. Whenever a job finishes, a new line of output is printed. So you are seeing all the evaluations.
Note that you don't tell bayesopt how many iterations to run, you tell it how many objective evaluations to run ('MaxObjectiveEvaluations').
I've omitted some details about what happens when multiple jobs finish at the same time, or when they finish so fast that you get idle workers.
##### 1 commentaireAfficher -1 commentaires plus anciensMasquer -1 commentaires plus anciens
Simon Stone le 24 Déc 2019
Thanks for this answer, that helps a lot!

Connectez-vous pour commenter.

### Catégories

En savoir plus sur Surface and Mesh Plots dans Help Center et File Exchange

### Community Treasure Hunt

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

Start Hunting!

Translated by