Skip to content

Apply a prior on the lengthscale, can't fit likelihood #1782

Answered by Balandat
defnetanyer asked this question in Q&A
Discussion options

You must be logged in to vote

Hi, I think there is some confusion about the batch_shape on your end. In this case you don't actually have a batched model, and so you don't have to set a batch_shape (functionally this means it's set to torch.Size([]) on the backend). If you change the line

covar_module = covar_module(ard_num_dims=train_x.shape[1], batch_shape= batch_shape))

to

covar_module = covar_module(ard_num_dims=train_x.shape[1], batch_shape=torch.Size()))

then this runs fine.

Now there is one thing to note - in the multi-output case (when you have more than one trailing dimension in train_y, then the model does some reshuffling of dimensions internally to fit these models as batched models for efficiency/speed …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@defnetanyer
Comment options

Answer selected by defnetanyer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants