index.html
13.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Documentation for Hyperopt, Distributed Asynchronous Hyper-parameter Optimization">
<link rel="canonical" href="http://hyperopt.github.io/hyperopt/">
<link rel="shortcut icon" href="img/favicon.ico">
<title>Hyperopt Documentation</title>
<link href="css/bootstrap-custom.min.css" rel="stylesheet">
<link href="css/font-awesome.min.css" rel="stylesheet">
<link href="css/base.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/github.min.css">
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<script src="js/jquery-1.10.2.min.js" defer></script>
<script src="js/bootstrap-3.0.3.min.js" defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/languages/yaml.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/languages/python.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
</head>
<body class="homepage">
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<!-- Collapsed navigation -->
<div class="navbar-header">
<!-- Expander button -->
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href=".">Hyperopt Documentation</a>
</div>
<!-- Expanded navigation -->
<div class="navbar-collapse collapse">
<!-- Main navigation -->
<ul class="nav navbar-nav">
<li class="active">
<a href=".">Home</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Getting started <b class="caret"></b></a>
<ul class="dropdown-menu">
<li >
<a href="getting-started/overview/">Getting started with Hyperopt</a>
</li>
<li >
<a href="getting-started/minimizing_functions/">Minimizing functions</a>
</li>
<li >
<a href="getting-started/search_spaces/">Defining search spaces</a>
</li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Installation <b class="caret"></b></a>
<ul class="dropdown-menu">
<li >
<a href="setup/installation-notes/">Installation notes</a>
</li>
<li >
<a href="setup/running-tests/">Running tests</a>
</li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Scale out <b class="caret"></b></a>
<ul class="dropdown-menu">
<li >
<a href="scaleout/mongodb/">MongoDB</a>
</li>
<li >
<a href="scaleout/spark/">Spark</a>
</li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Misc <b class="caret"></b></a>
<ul class="dropdown-menu">
<li >
<a href="interfacing-languages/">Interfacing with other languages</a>
</li>
<li >
<a href="related-work/">Related work</a>
</li>
<li >
<a href="scipy_submission/">SciPy 2013 submission</a>
</li>
</ul>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="#" data-toggle="modal" data-target="#mkdocs_search_modal">
<i class="fa fa-search"></i> Search
</a>
</li>
<li class="disabled">
<a rel="next" >
<i class="fa fa-arrow-left"></i> Previous
</a>
</li>
<li >
<a rel="prev" href="getting-started/overview/">
Next <i class="fa fa-arrow-right"></i>
</a>
</li>
<li>
<a href="http://github.com/hyperopt/hyperopt/edit/master/docs/index.md"><i class="fa fa-github"></i> Edit on GitHub</a>
</li>
</ul>
</div>
</div>
</div>
<div class="container">
<div class="col-md-3"><div class="bs-sidebar hidden-print affix well" role="complementary">
<ul class="nav bs-sidenav">
<li class="main active"><a href="#hyperopt-distributed-asynchronous-hyper-parameter-optimization">Hyperopt: Distributed Asynchronous Hyper-parameter Optimization</a></li>
<li><a href="#getting-started">Getting started</a></li>
<li><a href="#algorithms">Algorithms</a></li>
<li><a href="#documentation">Documentation</a></li>
<li><a href="#examples">Examples</a></li>
<li><a href="#announcements-mailing-list">Announcements mailing list</a></li>
<li><a href="#discussion-mailing-list">Discussion mailing list</a></li>
<li><a href="#cite">Cite</a></li>
<li><a href="#thanks">Thanks</a></li>
</ul>
</div></div>
<div class="col-md-9" role="main">
<h1 id="hyperopt-distributed-asynchronous-hyper-parameter-optimization">Hyperopt: Distributed Asynchronous Hyper-parameter Optimization</h1>
<h2 id="getting-started">Getting started</h2>
<p>Install hyperopt from PyPI</p>
<pre><code class="bash">pip install hyperopt
</code></pre>
<p>to run your first example</p>
<pre><code class="python"># define an objective function
def objective(args):
case, val = args
if case == 'case 1':
return val
else:
return val ** 2
# define a search space
from hyperopt import hp
space = hp.choice('a',
[
('case 1', 1 + hp.lognormal('c1', 0, 1)),
('case 2', hp.uniform('c2', -10, 10))
])
# minimize the objective over the space
from hyperopt import fmin, tpe
best = fmin(objective, space, algo=tpe.suggest, max_evals=100)
print best
# -> {'a': 1, 'c2': 0.01420615366247227}
print hyperopt.space_eval(space, best)
# -> ('case 2', 0.01420615366247227}
</code></pre>
<p>If you're a developer, clone this repository and install from source:</p>
<pre><code class="bash">git clone https://github.com/jaberg/hyperopt.git
cd hyperopt && python setup.py develop && pip install -e '.[MongoTrials, SparkTrials, ATPE]'
</code></pre>
<h2 id="algorithms">Algorithms</h2>
<p>Currently three algorithms are implemented in hyperopt:</p>
<ul>
<li>Random Search</li>
<li><a href="https://papers.nips.cc/paper/4443-algorithms-for-hyper-parameter-optimization.pdf">Tree of Parzen Estimators (TPE)</a></li>
<li><a href="https://www.electricbrain.io/blog/learning-to-optimize">Adaptive TPE</a></li>
</ul>
<p>Hyperopt has been designed to accommodate Bayesian optimization algorithms based on Gaussian processes and regression trees, but these are not currently implemented.</p>
<p>All algorithms can be parallelized in two ways, using:</p>
<ul>
<li><a href="https://spark.apache.org/">Apache Spark</a></li>
<li><a href="https://mongodb.com">MongoDB</a></li>
</ul>
<h2 id="documentation">Documentation</h2>
<p><a href="http://hyperopt.github.io/hyperopt">Hyperopt documentation can be found here</a>, but is partly still hosted on the wiki. Here are some quick links to the most relevant pages:</p>
<ul>
<li><a href="https://github.com/hyperopt/hyperopt/wiki/FMin">Basic tutorial</a></li>
<li><a href="https://github.com/hyperopt/hyperopt/wiki/Installation-Notes">Installation notes</a></li>
<li><a href="https://github.com/hyperopt/hyperopt/wiki/Parallelizing-Evaluations-During-Search-via-MongoDB">Using mongodb</a></li>
</ul>
<h2 id="examples">Examples</h2>
<p>See <a href="https://github.com/hyperopt/hyperopt/wiki/Hyperopt-in-Other-Projects">projects using hyperopt</a> on the wiki.</p>
<h2 id="announcements-mailing-list">Announcements mailing list</h2>
<p><a href="https://groups.google.com/forum/#!forum/hyperopt-announce">Announcments</a></p>
<h2 id="discussion-mailing-list">Discussion mailing list</h2>
<p><a href="https://groups.google.com/forum/#!forum/hyperopt-discuss">Discussion</a></p>
<h2 id="cite">Cite</h2>
<p>If you use this software for research, plase cite the following paper:</p>
<p>Bergstra, J., Yamins, D., Cox, D. D. (2013) Making a Science of Model Search: Hyperparameter Optimization in Hundreds of Dimensions for Vision Architectures. To appear in Proc. of the 30th International Conference on Machine Learning (ICML 2013).</p>
<h2 id="thanks">Thanks</h2>
<p>This project has received support from</p>
<ul>
<li>National Science Foundation (IIS-0963668),</li>
<li>Banting Postdoctoral Fellowship program,</li>
<li>National Science and Engineering Research Council of Canada (NSERC),</li>
<li>D-Wave Systems, Inc.</li>
</ul></div>
</div>
<footer class="col-md-12">
<hr>
<p>Documentation built with <a href="https://www.mkdocs.org/">MkDocs</a>.</p>
</footer>
<script>
var base_url = ".",
shortcuts = {"search": 83, "next": 78, "help": 191, "previous": 80};
</script>
<script src="js/base.js" defer></script>
<script src="search/main.js" defer></script>
<div class="modal" id="mkdocs_search_modal" tabindex="-1" role="dialog" aria-labelledby="Search Modal" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
<h4 class="modal-title" id="exampleModalLabel">Search</h4>
</div>
<div class="modal-body">
<p>
From here you can search these documents. Enter
your search terms below.
</p>
<form role="form">
<div class="form-group">
<input type="text" class="form-control" placeholder="Search..." id="mkdocs-search-query" title="Type search term here">
</div>
</form>
<div id="mkdocs-search-results"></div>
</div>
<div class="modal-footer">
</div>
</div>
</div>
</div><div class="modal" id="mkdocs_keyboard_modal" tabindex="-1" role="dialog" aria-labelledby="Keyboard Shortcuts Modal" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
<h4 class="modal-title" id="exampleModalLabel">Keyboard Shortcuts</h4>
</div>
<div class="modal-body">
<table class="table">
<thead>
<tr>
<th style="width: 20%;">Keys</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr>
<td class="help shortcut"><kbd>?</kbd></td>
<td>Open this help</td>
</tr>
<tr>
<td class="next shortcut"><kbd>n</kbd></td>
<td>Next page</td>
</tr>
<tr>
<td class="prev shortcut"><kbd>p</kbd></td>
<td>Previous page</td>
</tr>
<tr>
<td class="search shortcut"><kbd>s</kbd></td>
<td>Search</td>
</tr>
</tbody>
</table>
</div>
<div class="modal-footer">
</div>
</div>
</div>
</div>
</body>
</html>
<!--
MkDocs version : 1.0.4
Build Date UTC : 2019-10-18 12:19:35
-->