Commit 8cd50e3f authored by suiguoxin's avatar suiguoxin
Browse files

support quniform type; update doc; update test config

parent ba8dccd6
...@@ -69,3 +69,6 @@ build ...@@ -69,3 +69,6 @@ build
*.egg-info *.egg-info
.vscode .vscode
# yarn lockfile
yarn.lock
...@@ -374,7 +374,7 @@ advisor: ...@@ -374,7 +374,7 @@ advisor:
> Builtin Tuner Name: **GPTuner** > Builtin Tuner Name: **GPTuner**
Note that the only acceptable types of search space are `choice`, `quniform`, `uniform` and `randint`. Note that the only acceptable types of search space are `choice`, `randint`, `uniform`, `quniform`, `loguniform`, `qloguniform`.
**Suggested scenario** **Suggested scenario**
...@@ -383,7 +383,7 @@ GP Tuner is uses a proxy optimization problem (finding the maximum of the acquis ...@@ -383,7 +383,7 @@ GP Tuner is uses a proxy optimization problem (finding the maximum of the acquis
**Requirement of classArg** **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. * **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. * **utility** (*'ei', 'ucb' or 'poi', optional, default = 'ei'*) - The kind of utility function(acquisition 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. * **kappa** (*float, optional, default = 5*) - Used by utility function 'ucb'. The bigger `kappa` is, the more the tuner will be exploratory.
* **xi** (*float, optional, default = 0*) - Used by utility function 'ei' and 'poi'. The bigger `xi` is, the more the tuner will be exploratory. * **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. * **nu** (*float, optional, default = 2.5*) - Used to specify Matern kernel. The smaller nu, the less smooth the approximated function is.
...@@ -405,6 +405,6 @@ tuner: ...@@ -405,6 +405,6 @@ tuner:
nu: 2.5 nu: 2.5
alpha: 1e-6 alpha: 1e-6
cold_start_num: 10 cold_start_num: 10
selection_num_warm_up: 1e5 selection_num_warm_up: 100000
selection_num_starting_points: 250 selection_num_starting_points: 250
``` ```
...@@ -99,6 +99,8 @@ The total search space is 1,204,224, we set the number of maximum trial to 1000. ...@@ -99,6 +99,8 @@ The total search space is 1,204,224, we set the number of maximum trial to 1000.
| HyperBand |0.416807|0.417549|0.418828| | HyperBand |0.416807|0.417549|0.418828|
| HyperBand |0.415550|0.415977|0.417186| | HyperBand |0.415550|0.415977|0.417186|
| GP |0.414353|0.418563|0.420263| | GP |0.414353|0.418563|0.420263|
| GP |0.414395|0.418006|0.420431|
| GP |0.416807|0.418095|0.420507|
For Metis, there are about 300 trials because it runs slowly due to its high time complexity O(n^3) in Gaussian Process. For Metis, there are about 300 trials because it runs slowly due to its high time complexity O(n^3) in Gaussian Process.
......
...@@ -161,10 +161,9 @@ ...@@ -161,10 +161,9 @@
version "10.5.2" version "10.5.2"
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.5.2.tgz#f19f05314d5421fe37e74153254201a7bf00a707" resolved "https://registry.yarnpkg.com/@types/node/-/node-10.5.2.tgz#f19f05314d5421fe37e74153254201a7bf00a707"
"@types/node@10.12.18": "@types/node@^10.5.5":
version "10.12.18" version "10.5.5"
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.18.tgz#1d3ca764718915584fcd9f6344621b7672665c67" resolved "https://registry.yarnpkg.com/@types/node/-/node-10.5.5.tgz#8e84d24e896cd77b0d4f73df274027e3149ec2ba"
integrity sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ==
"@types/range-parser@*": "@types/range-parser@*":
version "1.2.2" version "1.2.2"
...@@ -343,6 +342,10 @@ ansi-regex@^3.0.0: ...@@ -343,6 +342,10 @@ ansi-regex@^3.0.0:
version "3.0.0" version "3.0.0"
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" 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: ansi-styles@^3.2.1:
version "3.2.1" version "3.2.1"
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d"
...@@ -448,6 +451,14 @@ azure-storage@^2.10.2: ...@@ -448,6 +451,14 @@ azure-storage@^2.10.2:
xml2js "0.2.8" xml2js "0.2.8"
xmlbuilder "^9.0.7" 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: balanced-match@^1.0.0:
version "1.0.0" version "1.0.0"
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
...@@ -564,6 +575,16 @@ chai@^4.1.2: ...@@ -564,6 +575,16 @@ chai@^4.1.2:
pathval "^1.0.0" pathval "^1.0.0"
type-detect "^4.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: chalk@^2.0.0, chalk@^2.3.0:
version "2.4.1" version "2.4.1"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e"
...@@ -833,7 +854,7 @@ escape-html@~1.0.3: ...@@ -833,7 +854,7 @@ escape-html@~1.0.3:
version "1.0.3" version "1.0.3"
resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" 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.5: escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5:
version "1.0.5" version "1.0.5"
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
...@@ -1142,6 +1163,12 @@ har-validator@~5.1.0: ...@@ -1142,6 +1163,12 @@ har-validator@~5.1.0:
ajv "^5.3.0" ajv "^5.3.0"
har-schema "^2.0.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: has-flag@^3.0.0:
version "3.0.0" version "3.0.0"
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd"
...@@ -1399,25 +1426,21 @@ js-base64@^2.4.9: ...@@ -1399,25 +1426,21 @@ js-base64@^2.4.9:
version "2.5.0" version "2.5.0"
resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.5.0.tgz#42255ba183ab67ce59a0dee640afdc00ab5ae93e" 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: js-tokens@^4.0.0:
version "4.0.0" version "4.0.0"
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
js-yaml@^3.10.0: js-yaml@^3.10.0, js-yaml@^3.7.0:
version "3.12.0" version "3.12.0"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.0.tgz#eaed656ec8344f10f527c6bfa1b6e2244de167d1" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.0.tgz#eaed656ec8344f10f527c6bfa1b6e2244de167d1"
dependencies: dependencies:
argparse "^1.0.7" argparse "^1.0.7"
esprima "^4.0.0" 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: jsbn@~0.1.0:
version "0.1.1" version "0.1.1"
resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513"
...@@ -1774,6 +1797,12 @@ node-jose@^1.1.0: ...@@ -1774,6 +1797,12 @@ node-jose@^1.1.0:
node-forge "^0.7.6" node-forge "^0.7.6"
uuid "^3.3.2" 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: node-pre-gyp@^0.10.3:
version "0.10.3" version "0.10.3"
resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.10.3.tgz#3070040716afdc778747b61b6887bf78880b80fc" resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.10.3.tgz#3070040716afdc778747b61b6887bf78880b80fc"
...@@ -2355,7 +2384,7 @@ sax@0.5.x: ...@@ -2355,7 +2384,7 @@ sax@0.5.x:
version "0.5.8" version "0.5.8"
resolved "http://registry.npmjs.org/sax/-/sax-0.5.8.tgz#d472db228eb331c2506b0e8c15524adb939d12c1" resolved "http://registry.npmjs.org/sax/-/sax-0.5.8.tgz#d472db228eb331c2506b0e8c15524adb939d12c1"
sax@^1.2.4: sax@>=0.6.0, sax@^1.2.4:
version "1.2.4" version "1.2.4"
resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9"
...@@ -2590,6 +2619,10 @@ supports-color@5.4.0, supports-color@^5.3.0: ...@@ -2590,6 +2619,10 @@ supports-color@5.4.0, supports-color@^5.3.0:
dependencies: dependencies:
has-flag "^3.0.0" 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: supports-color@^5.4.0:
version "5.5.0" version "5.5.0"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f"
...@@ -2683,43 +2716,32 @@ tslib@^1.8.0, tslib@^1.8.1: ...@@ -2683,43 +2716,32 @@ tslib@^1.8.0, tslib@^1.8.1:
version "1.9.3" version "1.9.3"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286"
tslint-microsoft-contrib@^6.0.0: tslint-microsoft-contrib@^5.1.0:
version "6.2.0" version "5.1.0"
resolved "https://registry.yarnpkg.com/tslint-microsoft-contrib/-/tslint-microsoft-contrib-6.2.0.tgz#8aa0f40584d066d05e6a5e7988da5163b85f2ad4" resolved "https://registry.yarnpkg.com/tslint-microsoft-contrib/-/tslint-microsoft-contrib-5.1.0.tgz#777c32d51aba16f4565e47aac749a1631176cd9f"
integrity sha512-6tfi/2tHqV/3CL77pULBcK+foty11Rr0idRDxKnteTaKm6gWF9qmaCNU17HVssOuwlYNyOmd9Jsmjd+1t3a3qw==
dependencies: dependencies:
tsutils "^2.27.2 <2.29.0" tsutils "^2.12.1"
tslint@^5.12.0: tslint@^5.11.0:
version "5.17.0" version "5.11.0"
resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.17.0.tgz#f9f0ce2011d8e90debaa6e9b4975f24cd16852b8" resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.11.0.tgz#98f30c02eae3cde7006201e4c33cb08b48581eed"
integrity sha512-pflx87WfVoYepTet3xLfDOLDm9Jqi61UXIKePOuca0qoAZyrGWonDG9VTbji58Fy+8gciUn8Bt7y69+KEVjc/w==
dependencies: dependencies:
"@babel/code-frame" "^7.0.0" babel-code-frame "^6.22.0"
builtin-modules "^1.1.1" builtin-modules "^1.1.1"
chalk "^2.3.0" chalk "^2.3.0"
commander "^2.12.1" commander "^2.12.1"
diff "^3.2.0" diff "^3.2.0"
glob "^7.1.1" glob "^7.1.1"
js-yaml "^3.13.1" js-yaml "^3.7.0"
minimatch "^3.0.4" minimatch "^3.0.4"
mkdirp "^0.5.1"
resolve "^1.3.2" resolve "^1.3.2"
semver "^5.3.0" semver "^5.3.0"
tslib "^1.8.0" tslib "^1.8.0"
tsutils "^2.29.0" tsutils "^2.27.2"
"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.29.0: tsutils@^2.12.1, tsutils@^2.27.2:
version "2.29.0" version "2.29.0"
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.29.0.tgz#32b488501467acbedd4b85498673a0812aca0b99" resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.29.0.tgz#32b488501467acbedd4b85498673a0812aca0b99"
integrity sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==
dependencies: dependencies:
tslib "^1.8.1" tslib "^1.8.1"
...@@ -2755,10 +2777,9 @@ typescript-string-operations@^1.3.1: ...@@ -2755,10 +2777,9 @@ typescript-string-operations@^1.3.1:
version "1.3.1" version "1.3.1"
resolved "https://registry.yarnpkg.com/typescript-string-operations/-/typescript-string-operations-1.3.1.tgz#461b886cc9ccd4dd16810b1f248b2e6f6580956b" resolved "https://registry.yarnpkg.com/typescript-string-operations/-/typescript-string-operations-1.3.1.tgz#461b886cc9ccd4dd16810b1f248b2e6f6580956b"
typescript@^3.2.2: typescript@^3.0.1:
version "3.5.2" version "3.0.1"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.5.2.tgz#a09e1dc69bc9551cadf17dba10ee42cf55e5d56c" resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.0.1.tgz#43738f29585d3a87575520a4b93ab6026ef11fdb"
integrity sha512-7KxJovlYhTX5RaRbUdkAXN1KUZ8PwWlTzQdHV6xNqvuFOs7+WBo10TQUqT19Q/Jz2hk5v9TQDIhyLhhJY4p5AA==
uglify-js@^3.1.4: uglify-js@^3.1.4:
version "3.4.9" version "3.4.9"
...@@ -2879,7 +2900,14 @@ xml2js@0.2.8: ...@@ -2879,7 +2900,14 @@ xml2js@0.2.8:
dependencies: dependencies:
sax "0.5.x" sax "0.5.x"
xmlbuilder@^9.0.7: 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:
version "9.0.7" version "9.0.7"
resolved "http://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz#132ee63d2ec5565c557e20f4c22df9aca686b10d" resolved "http://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz#132ee63d2ec5565c557e20f4c22df9aca686b10d"
...@@ -2920,4 +2948,4 @@ yargs@11.1.0: ...@@ -2920,4 +2948,4 @@ yargs@11.1.0:
yn@^2.0.0: yn@^2.0.0:
version "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"
\ No newline at end of file
...@@ -138,7 +138,7 @@ class TargetSpace(): ...@@ -138,7 +138,7 @@ class TargetSpace():
for i, _bound in enumerate(self._bounds): for i, _bound in enumerate(self._bounds):
if _bound['_type'] == 'choice' and all(isinstance(val, int) for val in _bound['_value']): if _bound['_type'] == 'choice' and all(isinstance(val, int) for val in _bound['_value']):
params.update({self.keys[i]: int(x[i])}) params.update({self.keys[i]: int(x[i])})
elif _bound['_type'] in ['randint', 'quniform']: elif _bound['_type'] in ['randint']:
params.update({self.keys[i]: int(x[i])}) params.update({self.keys[i]: int(x[i])})
else: else:
params.update({self.keys[i]: x[i]}) params.update({self.keys[i]: x[i]})
...@@ -175,18 +175,25 @@ class TargetSpace(): ...@@ -175,18 +175,25 @@ class TargetSpace():
""" """
params = np.empty(self.dim) params = np.empty(self.dim)
for col, _bound in enumerate(self._bounds): for col, _bound in enumerate(self._bounds):
if _bound['_type'] == 'uniform': if _bound['_type'] == 'choice':
params[col] = parameter_expressions.choice(
_bound['_value'], self.random_state)
elif _bound['_type'] == 'randint':
params[col] = self.random_state.randint(
_bound['_value'][0], _bound['_value'][1], size=1)
elif _bound['_type'] == 'uniform':
params[col] = parameter_expressions.uniform( params[col] = parameter_expressions.uniform(
_bound['_value'][0], _bound['_value'][1], self.random_state) _bound['_value'][0], _bound['_value'][1], self.random_state)
elif _bound['_type'] == 'quniform': elif _bound['_type'] == 'quniform':
params[col] = parameter_expressions.quniform( params[col] = parameter_expressions.quniform(
_bound['_value'][0], _bound['_value'][1], _bound['_value'][2], self.random_state) _bound['_value'][0], _bound['_value'][1], _bound['_value'][2], self.random_state)
elif _bound['_type'] == 'randint': elif _bound['_type'] == 'loguniform':
params[col] = self.random_state.randint( params[col] = parameter_expressions.loguniform(
_bound['_value'][0], _bound['_value'][1], size=1) _bound['_value'][0], _bound['_value'][1], self.random_state)
elif _bound['_type'] == 'choice': elif _bound['_type'] == 'qloguniform':
params[col] = parameter_expressions.choice( params[col] = parameter_expressions.qloguniform(
_bound['_value'], self.random_state) _bound['_value'][0], _bound['_value'][1], _bound['_value'][2], self.random_state)
return params return params
def max(self): def max(self):
......
...@@ -82,14 +82,14 @@ def acq_max(f_acq, gp, y_max, bounds, space, num_warmup, num_starting_points): ...@@ -82,14 +82,14 @@ def acq_max(f_acq, gp, y_max, bounds, space, num_warmup, num_starting_points):
# Warm up with random points # Warm up with random points
x_tries = [space.random_sample() x_tries = [space.random_sample()
for _ in range(num_warmup)] for _ in range(int(num_warmup)]
ys = f_acq(x_tries, gp=gp, y_max=y_max) ys = f_acq(x_tries, gp=gp, y_max=y_max)
x_max = x_tries[ys.argmax()] x_max = x_tries[ys.argmax()]
max_acq = ys.max() max_acq = ys.max()
# Explore the parameter space more throughly # Explore the parameter space more throughly
x_seeds = [space.random_sample() for _ in range(num_starting_points)] x_seeds = [space.random_sample() for _ in range(int(num_starting_points)]
bounds_minmax = np.array( bounds_minmax = np.array(
[[bound['_value'][0], bound['_value'][-1]] for bound in bounds]) [[bound['_value'][0], bound['_value'][-1]] for bound in bounds])
......
...@@ -13,6 +13,13 @@ assessor: ...@@ -13,6 +13,13 @@ assessor:
builtinAssessorName: Medianstop builtinAssessorName: Medianstop
classArgs: classArgs:
optimize_mode: maximize optimize_mode: maximize
kappa: 5
xi: 0
nu: 2.5
alpha: 1e-6
cold_start_num: 10
selection_num_warm_up: 100000
selection_num_starting_points: 250
trial: trial:
codeDir: ../../../examples/trials/mnist codeDir: ../../../examples/trials/mnist
command: python3 mnist.py --batch_num 100 command: python3 mnist.py --batch_num 100
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment