Hyperopt: Difference between revisions
From charlesreid1
No edit summary |
(→Usage) |
||
| Line 30: | Line 30: | ||
==Usage== | ==Usage== | ||
Random search over a space | |||
Notion of a score - you need some way to score the results | Notion of a score - you need some way to score the results | ||
Revision as of 21:16, 17 October 2017
Hyperopt is a hyperparameter optimization library.
Origin of the work was in searching through parameter spaces/sampling probability distributions of parameters.
Installing
Hyperopt relies on an older version of the networkx library. If you see this:
$ python myhyper.py
Traceback (most recent call last):
File "myhyper.py", line 14, in <module>
bestr = fmin(f, space, algo=rand.suggest, max_evals=100)
File "/usr/local/lib/python3.6/site-packages/hyperopt/fmin.py", line 314, in fmin
pass_expr_memo_ctrl=pass_expr_memo_ctrl)
File "/usr/local/lib/python3.6/site-packages/hyperopt/base.py", line 786, in __init__
pyll.toposort(self.expr)
File "/usr/local/lib/python3.6/site-packages/hyperopt/pyll/base.py", line 715, in toposort
assert order[-1] == expr
TypeError: 'generator' object is not subscriptable
Do this:
$ pip install networkx==1.11
Also see this Github issue: https://github.com/hyperopt/hyperopt/issues/325
Usage
Random search over a space
Notion of a score - you need some way to score the results
Example
Simple example to optimize a 2D quadratic function: $ x^2 + y^2 $