-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Conversation
suiguoxin
commented
Jun 21, 2019
- add a pure GP tuner with Matern kernel
- add related docs
…rs; fix link err in HpoComparision.md
…thedocs and github docs
@@ -19,7 +19,7 @@ Currently we support the following algorithms: | |||
|[__Network Morphism__](#NetworkMorphism)|Network Morphism provides functions to automatically search for architecture of deep learning models. Every child network inherits the knowledge from its parent network and morphs into diverse types of networks, including changes of depth, width, and skip-connection. Next, it estimates the value of a child network using the historic architecture and metric pairs. Then it selects the most promising one to train. [Reference Paper](https://arxiv.org/abs/1806.10282)| | |||
|[__Metis Tuner__](#MetisTuner)|Metis offers the following benefits when it comes to tuning parameters: While most tools only predict the optimal configuration, Metis gives you two outputs: (a) current prediction of optimal configuration, and (b) suggestion for the next trial. No more guesswork. While most tools assume training datasets do not have noisy data, Metis actually tells you if you need to re-sample a particular hyper-parameter. [Reference Paper](https://www.microsoft.com/en-us/research/publication/metis-robustly-tuning-tail-latencies-cloud-systems/)| | |||
|[__BOHB__](#BOHB)|BOHB is a follow-up work of Hyperband. It targets the weakness of Hyperband that new configurations are generated randomly without leveraging finished trials. For the name BOHB, HB means Hyperband, BO means Byesian Optimization. BOHB leverages finished trials by building multiple TPE models, a proportion of new configurations are generated through these models. [Reference Paper](https://arxiv.org/abs/1807.01774)| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please book a meeting to review your code.
Also could you give some experiment result in HPO.md, so that we could compare with other Tuner~
|
||
* **optimize_mode** (*'maximize' or 'minimize', optional, default = 'maximize'*) - If 'maximize', the tuner will target to maximize metrics. If 'minimize', the tuner will target to minimize metrics. | ||
* **utility** (*'ei', 'ucb' or 'poi', optional, default = 'ei'*) - The kind of utility function. 'ei', 'ucb' and 'poi' corresponds to 'Expected Improvement', 'Upper Confidence Bound' and 'Probability of Improvement' respectively. | ||
* **kappa** (*float, optional, default = 5*) - Used by utility function 'ucb'. The bigger `kappa` is, the more the tuner will be exploratory. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think part of them are optional classArg(if they have default value)...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of them are optimal. Normally no need to change them except for "optimize_mode" .
docs/en_US/BuiltinTuner.md
Outdated
|
||
> Builtin Tuner Name: **GPTuner** | ||
|
||
Note that the only acceptable types of search space are `choice`, `quniform`, `uniform` and `randint`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why cannot support other type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
loguniform
, qloguniform
added. Types like normal
are not supported here since a limited bound is needed.
docs/en_US/BuiltinTuner.md
Outdated
|
||
**Suggested scenario** | ||
|
||
GP Tuner is uses a proxy optimization problem (finding the maximum of the acquisition function) that, albeit still a hard problem, is cheaper (in the computational sense) and common tools can be employed. Therefore GP Tuner is most adequate for situations where sampling the function to be optimized is a very expensive endeavor. GP Tuner has a computationoal cost that grows at *O(N^3)* due to the requirement of inverting the Gram matrix. [Detailed Description](./GPTuner.md) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Therefore GP Tuner is most adequate for situations where sampling the function to be optimized is a very expensive endeavor", can you explain more?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explanation added.
|
||
Bayesian optimization works by constructing a posterior distribution of functions (Gaussian Process here) 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. | ||
|
||
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) and common tools can be employed. Therefore Bayesian Optimization is most adequate for situations where sampling the function to be optimized is a very expensive endeavor. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reference paper?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
paper link added
src/nni_manager/yarn.lock
Outdated
dependencies: | ||
tsutils "^2.12.1" | ||
tsutils "^2.27.2 <2.29.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why change here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've undo the commit of this file and added it to .gitignore
src/webui/yarn.lock
Outdated
@@ -1898,6 +1898,13 @@ copy-descriptor@^0.1.0: | |||
version "0.1.1" | |||
resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add at least one config-test for a new tuner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please discard change for yarn.lock
if no specific dependencies are added.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
config-test added
warnings.simplefilter("ignore") | ||
mean, std = gp.predict(x, return_std=True) | ||
|
||
z = (mean - y_max - xi)/std |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does any possible std == 0.0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tried to predict a known configuration with GP Regressor, the std is not zero.
docs/en_US/BuiltinTuner.md
Outdated
**Requirement of classArg** | ||
|
||
* **optimize_mode** (*'maximize' or 'minimize', optional, default = 'maximize'*) - If 'maximize', the tuner will target to maximize metrics. If 'minimize', the tuner will target to minimize metrics. | ||
* **utility** (*'ei', 'ucb' or 'poi', optional, default = 'ei'*) - The kind of utility function. 'ei', 'ucb' and 'poi' corresponds to 'Expected Improvement', 'Upper Confidence Bound' and 'Probability of Improvement' respectively. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how to select these choice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no fixed rule for choosing utility function since the block-box function to be optimized varies. Normally 'ei' is good choice who balances exploration and exploitation well. I think it interesting to expose theses choices to users who are interested in the tuning algorithm.
pylintrc
Outdated
@@ -15,7 +15,8 @@ max-attributes=15 | |||
const-naming-style=any | |||
|
|||
disable=duplicate-code, | |||
super-init-not-called | |||
super-init-not-called, | |||
cell-var-from-loop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any particular reason to add this rule?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to silent a pylint warning "cell variable define in loop". The warning is not reasonable. The code which got this warning is in sdk/pynni/nni/gu_tuner/util.py, line 41
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you really want to get rid of this warning, pls add comments to disable it. Not here in pylint.
src/nni_manager/yarn.lock
Outdated
@@ -161,9 +161,10 @@ | |||
version "10.5.2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chicm-ms pls take a look. Seems that we should not update this file in this commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@suiguoxin pls drop updates of this file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've undo the commit of this file and added it to .gitignore
@@ -98,6 +98,7 @@ The total search space is 1,204,224, we set the number of maximum trial to 1000. | |||
| HyperBand |0.414065|0.415222|0.417628| | |||
| HyperBand |0.416807|0.417549|0.418828| | |||
| HyperBand |0.415550|0.415977|0.417186| | |||
| GP |0.414353|0.418563|0.420263| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems that there's many hyper-params in GP tuner, pls consider adding experiments for them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also please put three times result here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Conf with full hyper-parameter are added in test-config.
Two more times results are added.
src/nni_manager/yarn.lock
Outdated
@@ -161,9 +161,10 @@ | |||
version "10.5.2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@suiguoxin pls drop updates of this file.
return mean + kappa * std | ||
|
||
@staticmethod | ||
def _ei(x, gp, y_max, xi): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any other code duplication for calc EI? After all there are other tuners that are relying on calculation of EI
src/webui/yarn.lock
Outdated
@@ -1898,6 +1898,13 @@ copy-descriptor@^0.1.0: | |||
version "0.1.1" | |||
resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please discard change for yarn.lock
if no specific dependencies are added.
pylintrc
Outdated
@@ -15,7 +15,8 @@ max-attributes=15 | |||
const-naming-style=any | |||
|
|||
disable=duplicate-code, | |||
super-init-not-called | |||
super-init-not-called, | |||
cell-var-from-loop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you really want to get rid of this warning, pls add comments to disable it. Not here in pylint.
if _type == "choice": | ||
# Find the closest integer in the array, vals_bounds | ||
vals_new.append( | ||
min(bound['_value'], key=lambda x: abs(x - vals[i]))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually this is a potential bug. Similar issue: https://stackoverflow.com/questions/25314547/cell-var-from-loop-warning-from-pylint pls consider fix it or disable the warning by comments.
src/nni_manager/yarn.lock
Outdated
@@ -2948,4 +2948,4 @@ yargs@11.1.0: | |||
|
|||
yn@^2.0.0: | |||
version "2.0.0" | |||
resolved "https://registry.yarnpkg.com/yn/-/yn-2.0.0.tgz#e5adabc8acf408f6385fc76495684c88e6af689a" | |||
resolved "https://registry.yarnpkg.com/yn/-/yn-2.0.0.tgz#e5adabc8acf408f6385fc76495684c88e6af689a" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you remove this change on yarn.lock?
.gitignore
Outdated
@@ -68,4 +68,4 @@ __pycache__ | |||
build | |||
*.egg-info | |||
|
|||
.vscode | |||
.vscode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please remove this change from this PR?
src/webui/yarn.lock
Outdated
@@ -8739,4 +8739,4 @@ yargs@~3.10.0: | |||
|
|||
zrender@4.0.4: | |||
version "4.0.4" | |||
resolved "https://registry.yarnpkg.com/zrender/-/zrender-4.0.4.tgz#910e60d888f00c9599073f23758dd23345fe48fd" | |||
resolved "https://registry.yarnpkg.com/zrender/-/zrender-4.0.4.tgz#910e60d888f00c9599073f23758dd23345fe48fd" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please remove this change?