22
$\begingroup$

There's substantial contemporary research on Bayesian Optimization (1) for tuning ML hyperparameters. The driving motivation here is that a minimal number of data points are required to make informed choices about what points are worthwhile to try (objective function calls are expensive, so making fewer is better) because training a model is time-intensive -- some modestly-large SVM problems that I've worked on can take between minutes and hours to complete.

On the other hand, Optunity is a particle swarm implementation to address for the same task. I'm not overwhelmingly familiar with PSO, but it seems like it must be less efficient in the sense of requiring a larger number of trial points, and therefore objective function evaluations, to assess the hyperparameter surface.

Am I missing a key detail that makes PSO preferred to BO in the machine learning context? Or is the choice between the two always inherently contextual for the hyperparameter tuning task?


(1) Shahriari et al, "Taking the Human out of the Loop: A Review of Bayesian Optimizaiton."

$\endgroup$
9
  • $\begingroup$ doesn't need gradient. works with discontinuity. moderately efficient. handles several dimensions. handles noise well. Has built-in robustness of estimator. $\endgroup$ Commented Feb 8, 2016 at 16:05
  • $\begingroup$ @EngrStudent You can say all of those things about BO, except BO appears to be more efficient because it requires a smaller number of function evaluation, at least in my reckoning. I'm not asking about PSO in general, I'm asking about its merits relative to BO. $\endgroup$
    – Sycorax
    Commented Feb 8, 2016 at 16:12
  • 1
    $\begingroup$ Not well enough educated on the topic to make this a definitive answer, but I would think Bayesian Optimization should suffer the same fate as most efficient optimizers with highly multi-modal problems (see: 95% of machine learning problems): it zeros in on the closest local minimum without "surveying" the global space. I think Particle Swarm would have better luck finding non-local minimums. $\endgroup$
    – Cliff AB
    Commented Mar 1, 2016 at 22:25
  • 2
    $\begingroup$ Apologies for my late arrival to the party, not sure how I managed to overlook a question about Optunity for so long! :-) $\endgroup$ Commented Mar 2, 2016 at 0:30
  • 1
    $\begingroup$ @MarcClaesen I must admit, I was hoping that you would find the time to reply at some point. Late or not, I think we're all glad that you have arrived. $\endgroup$
    – Sycorax
    Commented Mar 2, 2016 at 2:16

2 Answers 2

30
+50
$\begingroup$

As the lead developer of Optunity I'll add my two cents.

We have done extensive benchmarks comparing Optunity with the most popular Bayesian solvers (e.g., hyperopt, SMAC, bayesopt) on real-world problems, and the results indicate that PSO is in fact not less efficient in many practical cases. In our benchmark, which consists of tuning SVM classifiers on various datasets, Optunity is actually more efficient than hyperopt and SMAC, but slightly less efficient than BayesOpt. I would love to share the results here, but I'm going to wait until Optunity is finally published in JMLR (under review for over a year now, so don't hold your breath ...).

As you indicate, increased efficiency is a commonly used selling point for Bayesian optimization, but in practice it only holds water if the assumptions of the underlying surrogate models hold, which is far from trivial. In our experiments, Optunity's very simple PSO solver is often competitive with complex Bayesian approaches in terms of number of function evaluations. Bayesian solvers work very well when provided with good priors, but with an uninformative prior there is virtually no structural benefit over metaheuristic methods like PSO in terms of efficiency.

A big selling point for PSO is the fact it's embarassingly parallel. Bayesian optimization is often hard to parallelize, due to its inherently sequential nature (hyperopt's implementation being the only real exception). Given opportunities to distribute, which is becoming the norm, Optunity quickly takes the lead in wall-clock time to obtain good solutions.

Another key difference between Optunity and most other dedicated hyperparameter optimization libraries is the target audience: Optunity has the simplest interface and is targetted towards non-machine learning experts, whereas most other libraries require some understanding of Bayesian optimization to use effectively (i.e., they are targetted towards specialists).

The reason we made the library is that despite the fact dedicated hyperparameter optimization methods exist, they lack adoption in practice. Most people are still either not tuning at all, doing it manually, or via naive approaches like grid or random search. In our opinion, a key reason for this is the fact that existing libraries prior to developing Optunity were too difficult to use in terms of installation, documentation, API and often limited to a single environment.

$\endgroup$
13
  • 4
    $\begingroup$ As informed an answer as we could get! I'm curious: you say PSO solver is competitive with Bayesian Optimization approaches. Is that to say that PSO run in parallel is found to be faster than Bayseian Optimization run sequentially? Not trying to be mean, but it's an important distinction for me to understand. $\endgroup$
    – Cliff AB
    Commented Mar 2, 2016 at 0:19
  • 2
    $\begingroup$ Nope, both running sequentially. In our experiments (tuning SVMs), the efficiency of PSO and Bayesian optimization is competitive in terms of number of function evaluations. We didn't compare efficiency in terms of wall-clock time in distributed settings as that would be a bit of a cheap shot since many Bayesian optimization methods simply can't do that. $\endgroup$ Commented Mar 2, 2016 at 0:21
  • $\begingroup$ That's interesting. Any thoughts as to why? Unstable hyper-parameter surface? $\endgroup$
    – Cliff AB
    Commented Mar 2, 2016 at 0:23
  • 3
    $\begingroup$ I think there are several reasons. For one, hyperparameter surfaces have a lot of local optima (e.g., due to finite sample effects, cross-validation folds, inherent randomness in some learning approaches). Secondly, Bayesian optimization relies on building accurate surrogate objective functions, which is not an easy task until the objective function has been sampled plenty of times. Bayesian optimization takes a while before convergence speeds up (an often omitted detail). By that time metaheuristic methods like PSO have reached their local search phase too. PSO is very good at local search. $\endgroup$ Commented Mar 2, 2016 at 0:27
  • 4
    $\begingroup$ +1 for an excellent answer. I've built my own BO software, which I must admit is mostly a vanity project at this point, so I understand how the BO procedure works in some detail; I'm glad that I can start to scratch the surface of what else is going on the hyperparameter tuning world. Your remark about naive approaches really hits home with me, as one of my older naive tuning programs has been tuning a model for a week now with no end in sight... Thanks for your contribution, and I'm sure I'll have more questions once I digest this. $\endgroup$
    – Sycorax
    Commented Mar 2, 2016 at 2:20
0
$\begingroup$

The answer is problem-dependent and cannot be given without additional context. Typically, the answer would go as follows. Bayesian Optimization is more suitable for low-dimensional problems with the computational budget up to say 10x-100x the number of variables. PSO can be quite efficient for much larger budgets but is not state-of-the-art in its niche.

$\endgroup$
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.