Skip to content

Commit

Permalink
Use Standardize by default for SingleTaskGP (facebook#2630)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: facebook#2630

X-link: pytorch/botorch#2458

D60080819 recently updated the default `SingleTaskGP` BoTorch priors. One significant change was to remove the use of an outputscale, which may not work well if the outputs aren't standardized. This diff changes the `SingleTaskGP` to use `Standardize` and `Normalize` by default if no input/outcome transforms are specified (this allows users to explicitly pass in `None` if they don't want to use any transforms).

Differential Revision: D60492937
  • Loading branch information
David Eriksson authored and facebook-github-bot committed Aug 8, 2024
1 parent fd562d6 commit da13ab0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions ax/models/torch/botorch_defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,7 @@ def _get_model(
train_Yvar=None if all_nan_Yvar else Yvar,
covar_module=covar_module,
input_transform=warp_tf,
outcome_transform=None, # For backwards compatibility
**kwargs,
)
else:
Expand Down
11 changes: 11 additions & 0 deletions ax/models/torch/botorch_modular/surrogate.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,17 @@ def _set_formatted_inputs(
) -> None:
for input_name, input_class, input_options in inputs:
if input_class is None:
# This is a temporary solution until all BoTorch models use
# `Standardize` by default, see TODO [T197435440].
# After this, we should update `Surrogate` to use `DEFAULT`
# (https://fburl.com/code/22f4397e) for both of these args. This will
# allow users to explicitly disable the default transforms by passing
# in `None`.
if (
input_name in ["outcome_transform"]
and input_name in botorch_model_class_args
):
formatted_model_inputs[input_name] = None
continue
if input_name not in botorch_model_class_args:
# TODO: We currently only pass in `covar_module` and `likelihood`
Expand Down

0 comments on commit da13ab0

Please sign in to comment.