Skip to content

ROBOT tutorial notebook #2883

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

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open

Conversation

nataliemaus
Copy link
Contributor

Motivation

This PR adds a tutorial notebook for the Rank Ordered Bayesian Optimization with Trust Regions (ROBOT) method proposed by the AISTATS 2023 paper titled Discovering Many Diverse Solutions with Bayesian Optimization. The motivation for the notebook is to provide a simple clean example of how the ROBOT method can be applied in practice to optimize a set of diverse solutions to a black-box objective function.

Have you read the Contributing Guidelines on pull requests?

Yes.

Test Plan

The only change made is to add an isolated Jupyter notebook (robot.ipynb) to the tutorials folder. I checked that the notebook runs as it should and produces desired outputs. Since none of the BoTorch code was actually changed at all (all I did was add this notebook), no other tests are required as far as I am aware.

Related PRs

(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.)

@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Jun 16, 2025
@nataliemaus nataliemaus marked this pull request as draft June 16, 2025 16:45
@nataliemaus
Copy link
Contributor Author

@dme65 @jacobrgardner :)

@nataliemaus nataliemaus marked this pull request as ready for review June 16, 2025 17:09
Copy link

codecov bot commented Jun 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (6970f9b) to head (7ae4a75).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #2883   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          211       211           
  Lines        19512     19512           
=========================================
  Hits         19512     19512           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@esantorella esantorella left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thank you for submitting this! About how long does this notebook take to run? I think this probably belongs in notebooks_community since I'm not confident that the BoTorch team can promise to maintain this or run it regularly in the CI.

Edit: But feel free to keep it where it is for now so that we can keep getting CI signals on this -- seems like it's not running successfully now.

"metadata": {},
"outputs": [],
"source": [
"def delta(x1, x2 ):\n",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type annotations would be helpful for readability

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, thanks for adding those, I've committed your suggested changes.

{
"name": "stdout",
"output_type": "stream",
"text": [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we print less frequently?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah we could for example only print when the average reward improves, although I think can also be helpful for people to see an update on every iteration? I.e. in other tutorials such as turbo tutorial (https://github.com/pytorch/botorch/blob/main/tutorials/turbo_1/turbo_1.ipynb) there is a progress update printed on every iteration.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't feel too strongly about it -- I think if you're reading the tutorial it's nice for the output to be more minimal, but if you're running this yourself on your own data, it's nice to see verbose output

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a compromise, I modified to print every 10 iterations instead of every iteration 👍

@nataliemaus
Copy link
Contributor Author

@esantorella, thank you for reviewing this! Regarding your concern about it taking too long to run, I agree and added a SMOKE_TEST option so that in SMOKE_TEST mode it only iterates a couple of times and completes much faster. Given that update I think it should be okay to keep this in tutorials/ ?

@esantorella
Copy link
Member

Regarding your concern about it taking too long to run, I agree and added a SMOKE_TEST option so that in SMOKE_TEST mode it only iterates a couple of times and completes much faster. Given that update I think it should be okay to keep this in tutorials/ ?

Sounds reasonable to me since it isn't using any functionality from botorch_community.

@facebook-github-bot
Copy link
Contributor

@esantorella has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Do not delete this pull request or issue due to inactivity.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants