Open RemiDav opened 5 years ago
Hello @RemiDav, could you provide a minimum working example so that I can replicate this behaviour?
I think the problems comes when the optimization returns the same point to evaluate several times in a row:
import numpy as np
from pyGPGO.covfunc import squaredExponential
from pyGPGO.acquisition import Acquisition
from pyGPGO.surrogates.GaussianProcess import GaussianProcess
from pyGPGO.GPGO import GPGO
def f(x):
return (np.sin(x))
covfunc = squaredExponential()
gpr = GaussianProcess(covfunc)
acq = Acquisition(mode='ExpectedImprovement')
param = {'x': ('cont', [0, 2 * np.pi])}
gpgo_obj = GPGO(gpr, acq, f, param)
gpgo_obj.run(max_iter=1) #initialize
# run 6 evaluations at the same point
gpgo_obj.best = [0.]
gpgo_obj.updateGP()
gpgo_obj.updateGP()
gpgo_obj.updateGP()
gpgo_obj.updateGP()
gpgo_obj.updateGP()
gpgo_obj.updateGP()
I have an issue with GP.fit() when
self.covfunc.K(self.X, self.X)
returns a K that is not positive definite.I am suspecting that it happens when the same gpgo.best is selected several times in a row, but I am not sure. Is there a way to handle this ?
Traceback: