Giter Site home page Giter Site logo

pybo's People

Contributors

bshahr avatar mwhoffman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pybo's Issues

Recommending during initial sampling

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.

Noise-free optimization

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.

Pull out prior/model and clean it up

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.

Clean up sample GP functions

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:

  • sample N points from the given GP prior,
  • add those points to the GP,
  • in order to evaluate the function evaluate the mean and return that.

Fix pybo tests

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.

[ImportError: cannot import name _args_from_interpreter_flags] [dynamic figure stucked]

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

Enable support for Python 3

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!

Passing `fbest` to all policies

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.

Enable datastructures created by optimizer

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.

Improvement policies generating NaNs in the noise-free case

The improvement methods include two operations with potentially problematic behaviour (think NaNs), namely s = np.sqrt(s2) and z = d / s.

These NaNs 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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.