Skip to content
This repository has been archived by the owner on Feb 23, 2023. It is now read-only.

Is it possible to output the value of the acquisition function? #346

Open
RM-Liu opened this issue Oct 13, 2020 · 3 comments
Open

Is it possible to output the value of the acquisition function? #346

RM-Liu opened this issue Oct 13, 2020 · 3 comments

Comments

@RM-Liu
Copy link

RM-Liu commented Oct 13, 2020

Hi,
I'm trying to obtain the next suggested point over a subspace of the original space: if X=[y, z], I need the next y with fixed z. And BO.suggest_next_locations(context=z) is the way to go.

My question is:
When I have multiple sets of z, like z_1, z_2, ..., and I will get y_1, y_2,...
To get the 'best' y_i over all the y, I need to know the acquisition value of each point [y_i, z_i]. How could I do that?

Or is there any other way to do this? Many thanks!

@ekalosak
Copy link
Contributor

ekalosak commented Oct 13, 2020

Crudely, you could, instead of having z as a context variable, treat it like a normal parameter - then, at each step, change the parameter's domain to np.array([[z_1, z_2, ..]]). This should make [x,z] = BO.suggest_next_locations() give you the best z.

I should note that there is a way to do this using a context set as you propose, but you'll have to interact with the acquisition functions themselves, perhaps writing your own acquisition function. This isn't terribly hard, it's just more involved than the crude solution above.

@RM-Liu
Copy link
Author

RM-Liu commented Oct 17, 2020

Crudely, you could, instead of having z as a context variable, treat it like a normal parameter - then, at each step, change the parameter's domain to np.array([[z_1, z_2, ..]]). This should make [x,z] = BO.suggest_next_locations() give you the best z.

I should note that there is a way to do this using a context set as you propose, but you'll have to interact with the acquisition functions themselves, perhaps writing your own acquisition function. This isn't terribly hard, it's just more involved than the crude solution above.

Thanks for your solution. Maybe writing my own acq function is a better idea.

@LilyEvansHogwarts
Copy link

You can get the acquisition function value by running BO.acquisition.acquisition_function(x). For more details, you can also read the code in GPyOpt/GPyOpt/acquisitions folder.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants