Code Monkey home page Code Monkey logo

gpro's People

Contributors

chariff avatar kiudee avatar krisnguyen135 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

Watchers

 avatar  avatar

gpro's Issues

Problem when using Sensguide API: Application shutting down

I have been trying to use your software Sensguide, but the GUI application seems to always shut down when I try to use the "Update" function to generate random values for all features.
I am not sure what could cause this issue, I am using it on 64-bit Windows 10 Intel Core [email protected] GHz, 16GB RAM.
Could you let me know what could cause this problem and how to solve it?

Thank you!

Problem with running example: "2. Interactive bayesian optimisation"

Thanks very much for publishing GPro. I've been struggling with my own implementation of Chu and Ghahramani's work and I'm very grateful to be able to use your work. However, when running your example: "2. Interactive bayesian optimization." I have unfortunately encountered a problem. I have included the error traceback below:

 File "...\venv\lib\site-packages\GPro\preference.py", line 324, in bayesopt
    res = minimize(lambda x: -aqc_optim(x.reshape(1, -1),
  File "...\venv\lib\site-packages\scipy\optimize\_minimize.py", line 617, in minimize
    return _minimize_lbfgsb(fun, x0, args, jac, bounds,
  File "...\venv\lib\site-packages\scipy\optimize\lbfgsb.py", line 306, in _minimize_lbfgsb
    sf = _prepare_scalar_function(fun, x0, jac=jac, args=args, epsilon=eps,
  File "...\venv\lib\site-packages\scipy\optimize\optimize.py", line 261, in _prepare_scalar_function
    sf = ScalarFunction(fun, x0, args, grad, hess,
  File "...\venv\lib\site-packages\scipy\optimize\_differentiable_functions.py", line 95, in __init__
    self._update_grad()
  File "...\venv\lib\site-packages\scipy\optimize\_differentiable_functions.py", line 171, in _update_grad
    self._update_grad_impl()
  File "...\venv\lib\site-packages\scipy\optimize\_differentiable_functions.py", line 91, in update_grad
    self.g = approx_derivative(fun_wrapped, self.x, f0=self.f,
  File "...\venv\lib\site-packages\scipy\optimize\_numdiff.py", line 388, in approx_derivative
    raise ValueError("`f0` passed has more than 1 dimension.")
ValueError: `f0` passed has more than 1 dimension.

I've managed to get the example working by flattening the returned array from the acq_optim function on line 311 of the file preference.py. Do you think this is an appropriate solution to my error or does the problem lie elsewhere?
(By the way, I have implemented the code exactly as you have it in the example).

res.fun[0] not subscriptable

Hello,

I'm trying to follow the github readme for testing out the interactive optimization feature of the GPro package.

Everything as it is mentioned in the front page:

from GPro.kernels import Matern
from GPro.posterior import Laplace
from GPro.acquisitions import UCB
from GPro.optimization import ProbitBayesianOptimization
import numpy as np

3D example. Initialization.

X = np.random.sample(size=(2, 3)) * 10
M = np.array([0, 1]).reshape(-1, 2)

GP_params = {'kernel': Matern(length_scale=1, nu=2.5),
'post_approx': Laplace(s_eval=1e-5, max_iter=1000,
eta=0.01, tol=1e-3),
'acquisition': UCB(kappa=2.576),
'alpha': 1e-5,
'random_state': None}

gpr_opt = ProbitBayesianOptimization(X, M, GP_params)

bounds = {'x0': (0, 10), 'x1': (0, 10), 'x2': (0, 10)}

console_opt = gpr_opt.interactive_optimization(bounds=bounds, n_init=100, n_solve=1)
optimal_values, suggestion, X_post, M_post, f_post = console_opt
print('optimal values: ', optimal_values)

console_opt = gpr_opt.interactive_optimization(bounds=bounds, n_init=100, n_solve=1)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/GPro/optimization.py", line 118, in interactive_optimization
x_optim = self.bayesopt(bounds, method, n_init, n_solve)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/GPro/preference.py", line 358, in bayesopt
if max_acq is None or -res.fun[0] >= max_acq:
~~~~~~~^^^
TypeError: 'float' object is not subscriptable

Is there something wrong in the example?

Posterior predictive covariance and standard deviation

It seems the calculation of the posterior predictive covariance matrix might be more involved than https://github.com/chariff/GPro/blob/master/GPro/preference.py#L243.

Please see the top right corner of page 4 of Chu and Ghahramani, 2005.

The ฮ›_MAP (loss Hessian) matrix would need to be computed. The inversion of that matrix might be numerically difficult to do, but it seems with some algebra, we might only need to invert a nicer matrix, according to this document.

I'd be happy to take a stab at this if you'd like.

Thanks,
Quan

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.