GPTuner.rst 3.12 KB
Newer Older
liuzhe-lz's avatar
liuzhe-lz committed
1
2
GP Tuner
========
Guoxin's avatar
Guoxin committed
3

4
Bayesian optimization works by constructing a posterior distribution of functions (a Gaussian Process) that best describes the function you want to optimize. As the number of observations grows, the posterior distribution improves, and the algorithm becomes more certain of which regions in parameter space are worth exploring and which are not.
Guoxin's avatar
Guoxin committed
5

6
GP Tuner is designed to minimize/maximize the number of steps required to find a combination of parameters that are close to the optimal combination. To do so, this method uses a proxy optimization problem (finding the maximum of the acquisition function) that, albeit still a hard problem, is cheaper (in the computational sense) to solve, and it's amenable to common tools. Therefore, Bayesian Optimization is suggested for situations where sampling the function to be optimized is very expensive.
Guoxin's avatar
Guoxin committed
7

liuzhe-lz's avatar
liuzhe-lz committed
8
Note that the only acceptable types within the search space are ``randint``, ``uniform``, ``quniform``, ``loguniform``, ``qloguniform``, and numerical ``choice``.
9

10
This optimization approach is described in Section 3 of `Algorithms for Hyper-Parameter Optimization <https://papers.nips.cc/paper/4443-algorithms-for-hyper-parameter-optimization.pdf>`__.
ChrisZRen's avatar
ChrisZRen committed
11

12
13
Usage
-----
ChrisZRen's avatar
ChrisZRen committed
14
15
16
17

classArgs requirements
^^^^^^^^^^^^^^^^^^^^^^

liuzhe-lz's avatar
liuzhe-lz committed
18
19
20
21
22
23
24
25
26
* **optimize_mode** (*'maximize' or 'minimize', optional, default = 'maximize'*) - If 'maximize', the tuner will try to maximize metrics. If 'minimize', the tuner will try to minimize metrics.
* **utility** (*'ei', 'ucb' or 'poi', optional, default = 'ei'*) - The utility function (acquisition function). 'ei', 'ucb', and 'poi' correspond to 'Expected Improvement', 'Upper Confidence Bound', and 'Probability of Improvement', respectively.
* **kappa** (*float, optional, default = 5*) - Used by the 'ucb' utility function. The bigger ``kappa`` is, the more exploratory the tuner will be.
* **xi** (*float, optional, default = 0*) - Used by the 'ei' and 'poi' utility functions. The bigger ``xi`` is, the more exploratory the tuner will be.
* **nu** (*float, optional, default = 2.5*) - Used to specify the Matern kernel. The smaller nu, the less smooth the approximated function is.
* **alpha** (*float, optional, default = 1e-6*) - Used to specify the Gaussian Process Regressor. Larger values correspond to an increased noise level in the observations.
* **cold_start_num** (*int, optional, default = 10*) - Number of random explorations to perform before the Gaussian Process. Random exploration can help by diversifying the exploration space.
* **selection_num_warm_up** (*int, optional, default = 1e5*) - Number of random points to evaluate when getting the point which maximizes the acquisition function.
* **selection_num_starting_points** (*int, optional, default = 250*) - Number of times to run L-BFGS-B from a random starting point after the warmup.
ChrisZRen's avatar
ChrisZRen committed
27
28
29
30
31
32
33
34

Example Configuration
^^^^^^^^^^^^^^^^^^^^^

.. code-block:: yaml

   # config.yml
   tuner:
35
     name: GPTuner
ChrisZRen's avatar
ChrisZRen committed
36
37
38
39
40
41
42
43
44
     classArgs:
       optimize_mode: maximize
       utility: 'ei'
       kappa: 5.0
       xi: 0.0
       nu: 2.5
       alpha: 1e-6
       cold_start_num: 10
       selection_num_warm_up: 100000
45
       selection_num_starting_points: 250