You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is the current "Get Started" example on botorch.org:
# Fit a model
import torch
from botorch.models import SingleTaskGP
from botorch.fit import fit_gpytorch_mll
from botorch.utils import standardize
from gpytorch.mlls import ExactMarginalLogLikelihood
train_X = torch.rand(10, 2)
Y = 1 - torch.linalg.norm(train_X - 0.5, dim=-1, keepdim=True)
Y = Y + 0.1 * torch.randn_like(Y) # add some noise
train_Y = standardize(Y)
gp = SingleTaskGP(train_X, train_Y)
mll = ExactMarginalLogLikelihood(gp.likelihood, gp)
fit_gpytorch_mll(mll)
# Construct an acquisition function
from botorch.acquisition import UpperConfidenceBound
UCB = UpperConfidenceBound(gp, beta=0.1)
# Optimize the acquisition function
bounds = torch.stack([torch.zeros(2), torch.ones(2)])
candidate, acq_value = optimize_acqf(
UCB, bounds=bounds, q=1, num_restarts=5, raw_samples=20,
)
candidate # tensor([0.4887, 0.5063])
This code doesn't follow best practices in a few ways:
It uses standardize rather than a transform, so predictions will be in the transformed space, which can be hard to interpret. The Standardize outcome transform would be better.
It doesn't illustrate use of the Normalize input transform. I appreciate the concision of this example, but I think it's oversimplified; a user who runs this code on different data will get a warning telling them to normalize and not know how to do it.
The data and bounds are in single precision, which will also generate a warning.
We're more likely to recommend an acquisition function in the LogEI family than UCB.
Ideally, all references to standardize would be removed and there would be an audit of tutorials and other documentation for adherence to current best practices, but fixing the landing page would be a great improvement.
The text was updated successfully, but these errors were encountered:
Summary:
## Motivation
Getting-started documentation should be as simple as possible but no simpler. See #2421 for context.
### Have you read the [Contributing Guidelines on pull requests](https://github.com/pytorch/botorch/blob/main/CONTRIBUTING.md#pull-requests)?
Yes
Pull Request resolved: #2425
Test Plan:
- ran the example code to ensure it works
- built and ran the website locally and checked it looked okay
- previewed Markdown in Markdown viewer
Reviewed By: Balandat
Differential Revision: D59606022
Pulled By: esantorella
fbshipit-source-id: 201361879feb26cce309e3c49e8c7a497fabce5e
This is the current "Get Started" example on botorch.org:
This code doesn't follow best practices in a few ways:
standardize
rather than a transform, so predictions will be in the transformed space, which can be hard to interpret. TheStandardize
outcome transform would be better.Normalize
input transform. I appreciate the concision of this example, but I think it's oversimplified; a user who runs this code on different data will get a warning telling them to normalize and not know how to do it.Ideally, all references to
standardize
would be removed and there would be an audit of tutorials and other documentation for adherence to current best practices, but fixing the landing page would be a great improvement.The text was updated successfully, but these errors were encountered: