Slow bayesopt initialization in parallel computing
Mostrar comentarios más antiguos
Hi,
I am using a gaussian process regression model to fit my data through fitrgp function. I self defined a sort of complex kernel. I texted on a small subset of my data and got satisfied result. Now I apply it to my whole data with ‘UseParallel’ on. My questions are following:
1. Say I have 64 cores and set 1 worker per core. With setup as:
'OptimizeHyperparameters','auto', ...
'HyperparameterOptimizationOptions',...
struct('UseParallel', true, ...
'MaxObjectiveEvaluations', 64, ...
'Repartition', true, ...
'kfold', 20));
I understand the optimizer is bayesian opt, but how does the parallel look like? Is each objective function evaluation performed on all 64 workers simultaneously, and 64 evaluations go serial? Or instead, each evolution is computed on one worker, and 64 evaluations on their specific cores are computed in parallel?
2. I noticed, after getting the message:
“Copying objective function to workers...
Done copying objective function to workers.”
It takes quite a while (hours) before printing out further evaluation information. I guess it is because the initialization of bayesopt. Anything I can do to speed it up?
I also noticed, after getting the first evaluation print, the further 63 results are relatively faster. Why is that?
Thank you very much for your help.
Mono
Respuesta aceptada
Más respuestas (1)
Alan Weiss
el 27 de Nov. de 2018
0 votos
Perhaps the documentation in Parallel Bayesian Optimization can help. In particular, there are descriptions of several methods of getting the objective function onto the workers.
Also, and I do not know if this is what you are seeing, most MATLAB operations are faster the second time they are executed because MATLAB, an interpreted language, compiles on the fly and uses the compiled code in later calls.
Alan Weiss
MATLAB mathematical toolbox documentation
3 comentarios
mono
el 28 de Nov. de 2018
mono
el 28 de Nov. de 2018
Alan Weiss
el 28 de Nov. de 2018
The Bayesian optimization features in fitgrp are not as flexible or extensible as those in bayesopt itself. You will probably have to use bayesopt to do what you want most efficiently. And I hope that you noticed the descriptions of various ways of getting the objective function onto the workers. Some can save considerable time, especially for repeated optimizations, where you can leave the objective functions on the workers and just change some data.
Alan Weiss
MATLAB mathematical toolbox documentation
Categorías
Más información sobre Gaussian Process Regression en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!