Manually adding points and changing the utility function
See original GitHub issueI’m using the suggest-register paradigm and I’m doing two things that I think break something in the operation and I wanted to know how to do it correctly.
At some point, I want to suggest a parameter by myself, externally. So what I do is
my_pnt_from_an_oracle = 0
next_point = {'x': my_pnt_from_an_oracle}
optimizer.register(params=next_point, target=f(my_pnt_from_an_oracle) )
_ = optimizer.suggest(utility) # I also call this, although I'm not sure it is necessary
After that, I also want to change the utility to exploitation rather than exploration because I happen to know that the point I’m manually adding, is supposed to be at least some local maxima and also that it is for sure higher than all the points that were suggested until now. So I change:
utility = UtilityFunction(kind="ei", kappa=0, xi=1e-4) #xi was 10 originally
But now whenever I run the suggest-register combo, I don’t seem to get any suggestions that are closer to my_pnt_from_an_oracle
to try to find a better maximum. I think it may not be registered correctly? Although, it appears in optimizer.res
.
Any suggestion on how to add a point and change the utility in the middle of an operation?
Issue Analytics
- State:
- Created a year ago
- Comments:17
Top GitHub Comments
Yes, another thing that helped me is:
You’re right about the length scale, it is weird that the length_scale matters, because after the fit if I look at
optimizer._gp.kernel_
it has a different length_scale.I think I’m withdrawing my question now that I get that the problem is the fact that I don’t get a good fit for a GP or if I do, it is overfitting the observations.
The reason is that anyway it’s going to have high uncertainty between the observations and essentially the problem is ill-posed so the suggestions are random or almost random. So it won’t go necessarily to the maximum value of the point I added, but according to the acquisition function.
And also, It is not just when adding points manually. It’s going to happen every time I can’t get a good fit. I’ll have to think about what I can do about it, but I don’t think there’s any problem with your package.
p.s. - thank you for your help and time!!
if you are having issues with over fitting, you can also set the alpha parameter in the call to set_gp_params. higher values will regularity more heavily and prevent over-fitting.
It’s good that you checked that the gaussian process model is actually fitting your data. I think we should maybe generate a plot or something like that to make it easier for people to realise when the fit has failed…