chariff / gpro Goto Github PK
View Code? Open in Web Editor NEWPython package for Preference Learning with Gaussian Processes.
License: MIT License
Python package for Preference Learning with Gaussian Processes.
License: MIT License
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!
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).
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
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)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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?
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
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.