-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem using Gaussian Process when the objective function value is constant #59
Comments
@rzahra Can you copy-paste the py and json file of the Branin function that you are using here? As I was running myself with y_value=1 and GP, I did not get the error. In general, using a GP for a constant function is not smart but it should work... |
#!/usr/bin/python import os from hypermapper import optimizer # noqa def branin_function(X):
def main(): if name == "main": |
{
} |
@rzahra Strange. I didn't get the error. I was using the latest version of Hypermapper from this repo. Pip version is not yet updated as I can see... Can you maybe check that you are using the latest version of Hypermapper or check is there any mismatch between anaconda3 and Hypermapper My result...
|
Hi,
I've tried to run your "branin" example and considering a constant objective value, like "y_value = 1" for each input parameter. I set up the "model" to "Gaussian Process".
"models": {
"model": "gaussian_process"
},
But, it does not work and I've got the following error. Would you please let me know what is the problem?
Best Regards,
Zahra
Traceback (most recent call last):
File "branin.py", line 39, in
main()
File "branin.py", line 34, in main
optimizer.optimize(parameters_file, branin_function)
File "/home/zahra/anaconda3/lib/python3.7/site-packages/hypermapper/optimizer.py", line 125, in optimize
config, black_box_function=black_box_function, profiling=profiling
File "/home/zahra/anaconda3/lib/python3.7/site-packages/hypermapper/bo.py", line 391, in main
objective_limits=objective_limits,
File "/home/zahra/anaconda3/lib/python3.7/site-packages/hypermapper/models.py", line 457, in generate_mono_output_regression_models
regressor[Ycol].optimize()
File "/home/zahra/anaconda3/lib/python3.7/site-packages/GPy/core/gp.py", line 659, in optimize
ret = super(GP, self).optimize(optimizer, start, messages, max_iters, ipython_notebook, clear_after_finish, **kwargs)
File "/home/zahra/anaconda3/lib/python3.7/site-packages/paramz/model.py", line 111, in optimize
opt.run(start, f_fp=self._objective_grads, f=self._objective, fp=self._grads)
File "/home/zahra/anaconda3/lib/python3.7/site-packages/paramz/optimization/optimization.py", line 51, in run
self.opt(x_init, **kwargs)
File "/home/zahra/anaconda3/lib/python3.7/site-packages/paramz/optimization/optimization.py", line 124, in opt
opt_result = optimize.fmin_l_bfgs_b(f_fp, x_init, maxfun=self.max_iters, maxiter=self.max_iters, **opt_dict)
File "/home/zahra/anaconda3/lib/python3.7/site-packages/scipy/optimize/lbfgsb.py", line 199, in fmin_l_bfgs_b
**opts)
File "/home/zahra/anaconda3/lib/python3.7/site-packages/scipy/optimize/lbfgsb.py", line 345, in _minimize_lbfgsb
f, g = func_and_grad(x)
File "/home/zahra/anaconda3/lib/python3.7/site-packages/scipy/optimize/lbfgsb.py", line 295, in func_and_grad
f = fun(x, args)
File "/home/zahra/anaconda3/lib/python3.7/site-packages/scipy/optimize/optimize.py", line 327, in function_wrapper
return function((wrapper_args + args))
File "/home/zahra/anaconda3/lib/python3.7/site-packages/scipy/optimize/optimize.py", line 65, in call
fg = self.fun(x, *args)
File "/home/zahra/anaconda3/lib/python3.7/site-packages/paramz/model.py", line 273, in _objective_grads
self.optimizer_array = x
File "/home/zahra/anaconda3/lib/python3.7/site-packages/paramz/parameterized.py", line 339, in setattr
return object.setattr(self, name, val)
File "/home/zahra/anaconda3/lib/python3.7/site-packages/paramz/core/parameter_core.py", line 124, in optimizer_array
self.trigger_update()
File "/home/zahra/anaconda3/lib/python3.7/site-packages/paramz/core/updateable.py", line 79, in trigger_update
self._trigger_params_changed(trigger_parent)
File "/home/zahra/anaconda3/lib/python3.7/site-packages/paramz/core/parameter_core.py", line 134, in _trigger_params_changed
self.notify_observers(None, None if trigger_parent else -np.inf)
File "/home/zahra/anaconda3/lib/python3.7/site-packages/paramz/core/observable.py", line 91, in notify_observers
[callble(self, which=which) for _, _, callble in self.observers]
File "/home/zahra/anaconda3/lib/python3.7/site-packages/paramz/core/observable.py", line 91, in
[callble(self, which=which) for _, _, callble in self.observers]
File "/home/zahra/anaconda3/lib/python3.7/site-packages/paramz/core/parameter_core.py", line 508, in _parameters_changed_notification
self.parameters_changed()
File "/home/zahra/anaconda3/lib/python3.7/site-packages/GPy/core/gp.py", line 267, in parameters_changed
self.posterior, self._log_marginal_likelihood, self.grad_dict = self.inference_method.inference(self.kern, self.X, self.likelihood, self.Y_normalized, self.mean_function, self.Y_metadata)
File "/home/zahra/anaconda3/lib/python3.7/site-packages/GPy/inference/latent_function_inference/exact_gaussian_inference.py", line 58, in inference
Wi, LW, LWi, W_logdet = pdinv(Ky)
File "/home/zahra/anaconda3/lib/python3.7/site-packages/GPy/util/linalg.py", line 207, in pdinv
L = jitchol(A, *args)
File "/home/zahra/anaconda3/lib/python3.7/site-packages/GPy/util/linalg.py", line 75, in jitchol
raise linalg.LinAlgError("not positive definite, even with jitter.")
numpy.linalg.LinAlgError: not positive definite, even with jitter."
The text was updated successfully, but these errors were encountered: