Skip to content
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

[Feature Request] Acquisition Functions for Top-K Estimation #1733

Open
Ryan-Rhys opened this issue Mar 8, 2023 · 6 comments
Open

[Feature Request] Acquisition Functions for Top-K Estimation #1733

Ryan-Rhys opened this issue Mar 8, 2023 · 6 comments
Labels
enhancement New feature or request

Comments

@Ryan-Rhys
Copy link

Ryan-Rhys commented Mar 8, 2023

🚀 Feature Request

Acquisition function implementation for the task of top-k estimation with diversity as per the following paper:

https://arxiv.org/pdf/2210.01383.pdf

Motivation

Top-k estimation (estimating a set of k optimal designs under a penalty that encourages diversity) is an important task in applications such as virtual screening for drug discovery and materials design.

Additional context

@sangttruong is prepared to open a PR for his implementation.

@Ryan-Rhys Ryan-Rhys added the enhancement New feature or request label Mar 8, 2023
@eytan
Copy link
Contributor

eytan commented Mar 8, 2023 via email

@Balandat
Copy link
Contributor

This would be great to have. More than happy to provide guidance on the implementation.

As Eytan said, a generic setup for this would be nice. Maybe there are also opportunities to share some of the generic components with the entropy-based acquisition functions that were added recently.

@sangttruong
Copy link
Contributor

Thank you for your comment. I agree it would be good to have an EHIG abstract based class with a differentiable loss function. I will also write up a few test AFs from the paper, such as k-guess and top-k, to test out the separation of concerns and class structure.

@eytan
Copy link
Contributor

eytan commented Apr 5, 2023

Hi @sangttruong, just checking in on this. It would be really exciting to get this framework and AF into BoTorch. Let us know if there is any way we can help here, and we are happy to review intermediate diffs to provide feedback.

@sangttruong
Copy link
Contributor

Dear @eytan, I apologize for the delayed response -- it has been quite hectic starting the quarter here at Stanford. The good news is that I have the code almost ready with various loss functions, and I am trying to complete a few details before submitting a pull request. I also have a corresponding tutorial notebook for the sanity check. I am eager to receive your feedback.

@eytan
Copy link
Contributor

eytan commented Apr 13, 2023

No worries! Looking forward to it, thanks again!

facebook-github-bot pushed a commit that referenced this issue Aug 21, 2024
Summary:
<!--
Thank you for sending the PR! We appreciate you spending the time to make BoTorch better.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to BoTorch here: https://github.com/pytorch/botorch/blob/main/CONTRIBUTING.md
-->

## Motivation

This pull request introduces an implementation of the H-Entropy Search [1] procedure, along with a tutorial covering two tasks: Top-K Search and MinMax Search. This PR addresses issue #1733, which requested a new acquisition function for top-K search.
[1] W. Neiswanger, L. Yu, S. Zhao, C. Meng, S. Ermon. Generalizing Bayesian Optimization with Decision-theoretic Entropies. In Proceedings of the 36th Conference on Neural Information Processing Systems (NeurIPS 2022).

### Have you read the [Contributing Guidelines on pull requests](https://github.com/pytorch/botorch/blob/main/CONTRIBUTING.md#pull-requests)?

Yes, I have read the Contributing Guidelines on pull requests.

Pull Request resolved: #1794

Test Plan:
(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Bonus points for screenshots and videos!)

In the associated tutorial, two tests can be executed using the built-in 2D Ackley function with an input range of [-1, 1]. Within this range, there are four maxima located at each corner and one minimum at the center. The H-Entropy Search (HES) procedure, employing a Top-K (K = 2) loss function, is expected to identify two of the four maxima, with any combination being acceptable. Meanwhile, the H-Entropy Search procedure utilizing the MinMax loss function should locate one maximum and the central minimum.

Below are the results after running 10 steps of HES with MinMax:
![image](https://user-images.githubusercontent.com/45890770/232338473-b55c96f1-8710-4496-8d8f-15215889e818.png)

And here are the results after running 10 steps of HES with TopK:
![image](https://user-images.githubusercontent.com/45890770/232338763-0a142d74-96ff-4e4f-a364-92937087fec7.png)

Both images can be reproduced by following the respective tutorial.

## Related PRs

Not applicable.

(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/pytorch/botorch, and link to your PR here.)

Reviewed By: esantorella

Differential Revision: D46999676

Pulled By: saitcakmak

fbshipit-source-id: 4486c7e55919a331ed8bca9e7f2029ac7eeed54a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants