-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Add GP Tuner and related doc #1191
Changes from 13 commits
6099fb4
44cf69c
3f87626
b92c4ab
3be8892
0717988
db20820
21725f9
e35fa2b
17be796
3906b34
b776d7e
dbac6ed
df3952a
37f4b12
56a1575
ba8dccd
8cd50e3
942f519
ce4906f
a0d6cd1
10df680
c5f3da0
77c9547
d6febf2
66ba114
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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)| | ||
|
||
|[__GP Tuner__](#GPTuner)|Gaussian Process Tuner is a sequential model-based optimization (SMBO) approach with Gaussian Process as the surrogate. [Reference Paper, ](https://papers.nips.cc/paper/4443-algorithms-for-hyper-parameter-optimization.pdf)[Github Repo](https://github.com/fmfn/BayesianOptimization)| | ||
<br> | ||
|
||
## Usage of Builtin Tuners | ||
|
@@ -366,3 +366,45 @@ advisor: | |
max_budget: 27 | ||
eta: 3 | ||
``` | ||
<br> | ||
|
||
<a name="GPTuner"></a> | ||
|
||
![](https://placehold.it/15/1589F0/000000?text=+) `GP Tuner` | ||
|
||
> 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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
**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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. Explanation added. |
||
|
||
**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 commentThe 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 commentThe 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. |
||
* **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 commentThe 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 commentThe 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" . |
||
* **xi** (*float, optional, default = 0*) - Used by utility function 'ei' and 'poi'. The bigger `xi` is, the more the tuner will be exploratory. | ||
* **nu** (*float, optional, default = 2.5*) - Used to specify Matern kernel. The smaller nu, the less smooth the approximated function is. | ||
* **alpha** (*float, optional, default = 1e-6*) - Used to specify Gaussian Process Regressor. Larger values correspond to increased noise level in the observations. | ||
* **cold_start_num** (*int, optional, default = 10*) - Number of random exploration to perform before 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 for getting the point which maximizes the acquisition function. | ||
* **selection_num_starting_points** (*int, optional, default = 250*) - Nnumber of times to run L-BFGS-B from a random starting point after the warmup. | ||
|
||
**Usage example** | ||
|
||
```yaml | ||
# config.yml | ||
tuner: | ||
builtinTunerName: GPTuner | ||
classArgs: | ||
optimize_mode: maximize | ||
kappa: 5 | ||
xi: 0 | ||
nu: 2.5 | ||
alpha: 1e-6 | ||
cold_start_num: 10 | ||
selection_num_warm_up: 1e5 | ||
selection_num_starting_points: 250 | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
GP Tuner on NNI | ||
=== | ||
|
||
## GP Tuner | ||
|
||
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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. paper link added |
||
|
||
Note that the only acceptable types of search space are `choice`, `quniform`, `uniform` and `randint`. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -161,9 +161,10 @@ | |
version "10.5.2" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe 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 commentThe 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 |
||
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.5.2.tgz#f19f05314d5421fe37e74153254201a7bf00a707" | ||
|
||
"@types/node@^10.5.5": | ||
version "10.5.5" | ||
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.5.5.tgz#8e84d24e896cd77b0d4f73df274027e3149ec2ba" | ||
"@types/node@10.12.18": | ||
version "10.12.18" | ||
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.18.tgz#1d3ca764718915584fcd9f6344621b7672665c67" | ||
integrity sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ== | ||
|
||
"@types/range-parser@*": | ||
version "1.2.2" | ||
|
@@ -342,10 +343,6 @@ ansi-regex@^3.0.0: | |
version "3.0.0" | ||
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" | ||
|
||
ansi-styles@^2.2.1: | ||
version "2.2.1" | ||
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" | ||
|
||
ansi-styles@^3.2.1: | ||
version "3.2.1" | ||
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" | ||
|
@@ -451,14 +448,6 @@ azure-storage@^2.10.2: | |
xml2js "0.2.8" | ||
xmlbuilder "^9.0.7" | ||
|
||
babel-code-frame@^6.22.0: | ||
version "6.26.0" | ||
resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" | ||
dependencies: | ||
chalk "^1.1.3" | ||
esutils "^2.0.2" | ||
js-tokens "^3.0.2" | ||
|
||
balanced-match@^1.0.0: | ||
version "1.0.0" | ||
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" | ||
|
@@ -575,16 +564,6 @@ chai@^4.1.2: | |
pathval "^1.0.0" | ||
type-detect "^4.0.0" | ||
|
||
chalk@^1.1.3: | ||
version "1.1.3" | ||
resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" | ||
dependencies: | ||
ansi-styles "^2.2.1" | ||
escape-string-regexp "^1.0.2" | ||
has-ansi "^2.0.0" | ||
strip-ansi "^3.0.0" | ||
supports-color "^2.0.0" | ||
|
||
chalk@^2.0.0, chalk@^2.3.0: | ||
version "2.4.1" | ||
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e" | ||
|
@@ -854,7 +833,7 @@ escape-html@~1.0.3: | |
version "1.0.3" | ||
resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" | ||
|
||
escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: | ||
escape-string-regexp@1.0.5, escape-string-regexp@^1.0.5: | ||
version "1.0.5" | ||
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" | ||
|
||
|
@@ -1163,12 +1142,6 @@ har-validator@~5.1.0: | |
ajv "^5.3.0" | ||
har-schema "^2.0.0" | ||
|
||
has-ansi@^2.0.0: | ||
version "2.0.0" | ||
resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" | ||
dependencies: | ||
ansi-regex "^2.0.0" | ||
|
||
has-flag@^3.0.0: | ||
version "3.0.0" | ||
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" | ||
|
@@ -1426,21 +1399,25 @@ js-base64@^2.4.9: | |
version "2.5.0" | ||
resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.5.0.tgz#42255ba183ab67ce59a0dee640afdc00ab5ae93e" | ||
|
||
js-tokens@^3.0.2: | ||
version "3.0.2" | ||
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" | ||
|
||
js-tokens@^4.0.0: | ||
version "4.0.0" | ||
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" | ||
|
||
js-yaml@^3.10.0, js-yaml@^3.7.0: | ||
js-yaml@^3.10.0: | ||
version "3.12.0" | ||
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.0.tgz#eaed656ec8344f10f527c6bfa1b6e2244de167d1" | ||
dependencies: | ||
argparse "^1.0.7" | ||
esprima "^4.0.0" | ||
|
||
js-yaml@^3.13.1: | ||
version "3.13.1" | ||
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" | ||
integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== | ||
dependencies: | ||
argparse "^1.0.7" | ||
esprima "^4.0.0" | ||
|
||
jsbn@~0.1.0: | ||
version "0.1.1" | ||
resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" | ||
|
@@ -1797,12 +1774,6 @@ node-jose@^1.1.0: | |
node-forge "^0.7.6" | ||
uuid "^3.3.2" | ||
|
||
node-nvidia-smi@^1.0.0: | ||
version "1.0.0" | ||
resolved "https://registry.yarnpkg.com/node-nvidia-smi/-/node-nvidia-smi-1.0.0.tgz#6aa57574540b2bed91c9a80218516ffa686e5ac7" | ||
dependencies: | ||
xml2js "^0.4.17" | ||
|
||
node-pre-gyp@^0.10.3: | ||
version "0.10.3" | ||
resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.10.3.tgz#3070040716afdc778747b61b6887bf78880b80fc" | ||
|
@@ -2384,7 +2355,7 @@ sax@0.5.x: | |
version "0.5.8" | ||
resolved "http://registry.npmjs.org/sax/-/sax-0.5.8.tgz#d472db228eb331c2506b0e8c15524adb939d12c1" | ||
|
||
sax@>=0.6.0, sax@^1.2.4: | ||
sax@^1.2.4: | ||
version "1.2.4" | ||
resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" | ||
|
||
|
@@ -2619,10 +2590,6 @@ supports-color@5.4.0, supports-color@^5.3.0: | |
dependencies: | ||
has-flag "^3.0.0" | ||
|
||
supports-color@^2.0.0: | ||
version "2.0.0" | ||
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" | ||
|
||
supports-color@^5.4.0: | ||
version "5.5.0" | ||
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" | ||
|
@@ -2716,32 +2683,43 @@ tslib@^1.8.0, tslib@^1.8.1: | |
version "1.9.3" | ||
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" | ||
|
||
tslint-microsoft-contrib@^5.1.0: | ||
version "5.1.0" | ||
resolved "https://registry.yarnpkg.com/tslint-microsoft-contrib/-/tslint-microsoft-contrib-5.1.0.tgz#777c32d51aba16f4565e47aac749a1631176cd9f" | ||
tslint-microsoft-contrib@^6.0.0: | ||
version "6.2.0" | ||
resolved "https://registry.yarnpkg.com/tslint-microsoft-contrib/-/tslint-microsoft-contrib-6.2.0.tgz#8aa0f40584d066d05e6a5e7988da5163b85f2ad4" | ||
integrity sha512-6tfi/2tHqV/3CL77pULBcK+foty11Rr0idRDxKnteTaKm6gWF9qmaCNU17HVssOuwlYNyOmd9Jsmjd+1t3a3qw== | ||
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 commentThe 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 commentThe 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 |
||
|
||
tslint@^5.11.0: | ||
version "5.11.0" | ||
resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.11.0.tgz#98f30c02eae3cde7006201e4c33cb08b48581eed" | ||
tslint@^5.12.0: | ||
version "5.17.0" | ||
resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.17.0.tgz#f9f0ce2011d8e90debaa6e9b4975f24cd16852b8" | ||
integrity sha512-pflx87WfVoYepTet3xLfDOLDm9Jqi61UXIKePOuca0qoAZyrGWonDG9VTbji58Fy+8gciUn8Bt7y69+KEVjc/w== | ||
dependencies: | ||
babel-code-frame "^6.22.0" | ||
"@babel/code-frame" "^7.0.0" | ||
builtin-modules "^1.1.1" | ||
chalk "^2.3.0" | ||
commander "^2.12.1" | ||
diff "^3.2.0" | ||
glob "^7.1.1" | ||
js-yaml "^3.7.0" | ||
js-yaml "^3.13.1" | ||
minimatch "^3.0.4" | ||
mkdirp "^0.5.1" | ||
resolve "^1.3.2" | ||
semver "^5.3.0" | ||
tslib "^1.8.0" | ||
tsutils "^2.27.2" | ||
tsutils "^2.29.0" | ||
|
||
"tsutils@^2.27.2 <2.29.0": | ||
version "2.28.0" | ||
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.28.0.tgz#6bd71e160828f9d019b6f4e844742228f85169a1" | ||
integrity sha512-bh5nAtW0tuhvOJnx1GLRn5ScraRLICGyJV5wJhtRWOLsxW70Kk5tZtpK3O/hW6LDnqKS9mlUMPZj9fEMJ0gxqA== | ||
dependencies: | ||
tslib "^1.8.1" | ||
|
||
tsutils@^2.12.1, tsutils@^2.27.2: | ||
tsutils@^2.29.0: | ||
version "2.29.0" | ||
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.29.0.tgz#32b488501467acbedd4b85498673a0812aca0b99" | ||
integrity sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA== | ||
dependencies: | ||
tslib "^1.8.1" | ||
|
||
|
@@ -2777,9 +2755,10 @@ typescript-string-operations@^1.3.1: | |
version "1.3.1" | ||
resolved "https://registry.yarnpkg.com/typescript-string-operations/-/typescript-string-operations-1.3.1.tgz#461b886cc9ccd4dd16810b1f248b2e6f6580956b" | ||
|
||
typescript@^3.0.1: | ||
version "3.0.1" | ||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.0.1.tgz#43738f29585d3a87575520a4b93ab6026ef11fdb" | ||
typescript@^3.2.2: | ||
version "3.5.2" | ||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.5.2.tgz#a09e1dc69bc9551cadf17dba10ee42cf55e5d56c" | ||
integrity sha512-7KxJovlYhTX5RaRbUdkAXN1KUZ8PwWlTzQdHV6xNqvuFOs7+WBo10TQUqT19Q/Jz2hk5v9TQDIhyLhhJY4p5AA== | ||
|
||
uglify-js@^3.1.4: | ||
version "3.4.9" | ||
|
@@ -2900,14 +2879,7 @@ xml2js@0.2.8: | |
dependencies: | ||
sax "0.5.x" | ||
|
||
xml2js@^0.4.17: | ||
version "0.4.19" | ||
resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.4.19.tgz#686c20f213209e94abf0d1bcf1efaa291c7827a7" | ||
dependencies: | ||
sax ">=0.6.0" | ||
xmlbuilder "~9.0.1" | ||
|
||
xmlbuilder@^9.0.7, xmlbuilder@~9.0.1: | ||
xmlbuilder@^9.0.7: | ||
version "9.0.7" | ||
resolved "http://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz#132ee63d2ec5565c557e20f4c22df9aca686b10d" | ||
|
||
|
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~