mwhoffman / pybo Goto Github PK
View Code? Open in Web Editor NEWPython package for modular Bayesian optimization
License: BSD 2-Clause "Simplified" License
Python package for modular Bayesian optimization
License: BSD 2-Clause "Simplified" License
Currently, info['xbest']
is getting initialized to zeros in solve_bayesopt
which causes incorrect behaviour in initial sampling stage, particularly noticeable when the origin is not within the bounds and reaches a higher function value than any point within them.
It is also incorrect to recommend after the fact, because we'd be using the model with anachronistic information.
The easiest, most correct fix I can think of at the moment is to replace the list comprehension:
Y = [f(x) for x in X]
with a for loop which also sequentially recommends.
Hi,
Does Pybo support unbounded Bayesian optimization setting as described in http://www.jmlr.org/proceedings/papers/v51/shahriari16.html ?
Thanks,
Vu
There may need to be some slight interface tweaks to make it easy to perform noise-free optimization. IE the main thing here is that we should set the noise variance to something small (1e-10, 1e-6, etc.) and then make sure that the "prior" associated with that component is None
so that it doesn't get sampled/optimized.
This can be done manually at the moment, but it would be nice to be able to do so with something like solve_bayesopt(..., noisefree=True)
or similar.
Simplify how we pass models into the system such that rather than specifying a GP, prior, and inference method these have to be specified outside and then passed in as a "model" parameter.
The sample GP functions currently use the random features idea to sample a closed-form function and then optimize that. This has problems in that this only works for kernels that have the random-features helper code implemented. Instead we can implement random functions as follows:
The current set of nose-tests are broken and need to be fixed. This is really just because of the rearrangement of code and now some of the imports don't exist.
1. When I execute animated.py on Pycharm or terminal:
:/PROJECT/BO/CODE/pybo-master/pybo/demos$ python -m animated/PROJECT/BO/CODE/pybo-master/pybo/demos$ python animated.py
:
the following error always comes out:ImportError: cannot import name _args_from_interpreter_flags!!!
2. But when I execute python -m pybo.demos.animated, it can run. But I only get the dynamic figure for the first time when I installed it! Then every time when it runs, it get stucked and no figure displays!!!
/home/lidan/anaconda3/envs/py2/lib/python2.7/site-packages/matplotlib/init.py:878: UserWarning: axes.color_cycle is deprecated and replaced with axes.prop_cycle; please use the latter.
warnings.warn(self.msg_depr % (key, alt_key))
Traceback (most recent call last):
File "/home/lidan/anaconda3/envs/py2/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"main", fname, loader, pkg_name)
File "/home/lidan/anaconda3/envs/py2/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/home/lidan/PROJECT/BO/CODE/pybo-master/pybo/demos/animated.py", line 14, in
from reggie import make_gp, MCMC
File "/home/lidan/anaconda3/envs/py2/lib/python2.7/site-packages/reggie/init.py", line 7, in
from .models import *
File "/home/lidan/anaconda3/envs/py2/lib/python2.7/site-packages/reggie/models/init.py", line 7, in
from .gp import *
File "/home/lidan/anaconda3/envs/py2/lib/python2.7/site-packages/reggie/models/gp/init.py", line 7, in
from .gp import *
File "/home/lidan/anaconda3/envs/py2/lib/python2.7/site-packages/reggie/models/gp/gp.py", line 20, in
from ... import kernels
File "/home/lidan/anaconda3/envs/py2/lib/python2.7/site-packages/reggie/kernels/init.py", line 7, in
from .se import *
File "/home/lidan/anaconda3/envs/py2/lib/python2.7/site-packages/reggie/kernels/se.py", line 15, in
from ._distances import rescale, dist, dist_foreach, diff
File "/home/lidan/anaconda3/envs/py2/lib/python2.7/site-packages/reggie/kernels/_distances.py", line 9, in
import scipy.spatial.distance as ssd
File "/home/lidan/anaconda3/envs/py2/lib/python2.7/site-packages/scipy/spatial/init.py", line 93, in
from .ckdtree import *
File "scipy/spatial/ckdtree.pyx", line 20, in init scipy.spatial.ckdtree (scipy/spatial/ckdtree.cxx:17747)
File "/home/lidan/anaconda3/envs/py2/lib/python2.7/multiprocessing/init.py", line 65, in
from multiprocessing.util import SUBDEBUG, SUBWARNING
File "/home/lidan/anaconda3/envs/py2/lib/python2.7/multiprocessing/util.py", line 41, in
from subprocess import _args_from_interpreter_flags
ImportError: cannot import name _args_from_interpreter_flags
python version:
Python 2.7.12 |Anaconda custom (64-bit)| (default, Jul 2 2016, 17:42:40)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2
When I do:
from pybo import solve_bayesopt
the following error occurs:
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-d54e95bf7a31> in <module>()
10 from data_loader import *
11 from evaluator import *
---> 12 from pybo import solve_bayesopt
/Users/bryan.liu/anaconda/envs/Python3/lib/python3.5/site-packages/pybo/__init__.py in <module>()
4
5 # pylint: disable=wildcard-import
----> 6 from .bayesopt import *
7
8 from . import bayesopt
/Users/bryan.liu/anaconda/envs/Python3/lib/python3.5/site-packages/pybo/bayesopt.py in <module>()
13 import functools
14 import os.path
---> 15 import cPickle as pickle
16 import collections
17
ImportError: No module named 'cPickle'
The error is not seen if I use a Python 2-based environment, which lead to my belief that this is due to the replacement of cPickle
to a more general pickle
from Python 3.
While I am happy to stick with Python 2 for the moment, it might be a good idea to extend support to Python 3 as well. I am happy to circle back once I am done with the main work involving this lovely library (though would appreciate if other who have more free time to spare to have a go at it!).
Thanks a lot!
Implement Thompson cleanly. This should be relatively easy to implement, it just needs to be done.
I left a comment in GPPolicy
because it passes fbest
to all policies. At the moment, UCB has no use for it and ignores it; Thompson will not use it and neither will the Entropy Search methods. We should think about this a little more.
In order to enable the "growing grid" (as in spearmint) or possibly "growing tree" (as in bamsoo) approaches to optimization we should allow for the solve method to initialize and modify a datastructure.
The bounds mentioned for Branin in line 89 and 93 of pybo/models/functions.py are wrong. Should be bounds = [[-5, 10], [0, 15]]
.
The improvement methods include two operations with potentially problematic behaviour (think NaN
s), namely s = np.sqrt(s2)
and z = d / s
.
These NaN
s only creep up in the noise-free case because our nugget parameter is set too low (fixing this now) but we may want to include additional safeguards in the policies themselves.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.