Skip to content

[Bug] SingleTaskVariationalGP raises a warning when using input_transform #1824

Open
@crasanders

Description

🐛 Bug

Calling SingleTaskVariationalGP.posterior with an input_transform raises a warning, whereas the equivalent call with SingleTaskGP does not. I'm not sure if input_transform works correctly with SingleTaskVariationalGP or if I can safely interpret the resulting posterior. It also seems a little odd to me that this would be a warning and not an exception.

To reproduce

** Code snippet to reproduce **

import torch
from botorch.models import SingleTaskGP, SingleTaskVariationalGP
from botorch.models.transforms import Normalize

X = torch.rand((20, 1))
y = torch.sin(X)

model = SingleTaskGP(train_X=X, train_Y=y, input_transform=Normalize(1))
post = model.posterior(X) # No warning

model = SingleTaskVariationalGP(train_X=X, train_Y=y, input_transform=Normalize(1))
post = model.posterior(X) # Warning

** Stack trace/error message **

RuntimeWarning: Could not update `train_inputs` with transformed inputs since SingleTaskVariationalGP does not have a `train_inputs` attribute. Make sure that the `input_transform` is applied to both the train inputs and test inputs.```

System information

botorch version = 0.8.5
gpytorch version = 1.10
torch version = 1.13.1

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions