Strange covar module in MixedSingleTaskGP #1457
-
Its pydocs (https://github.com/pytorch/botorch/blob/98503e4db839dcf92e60fa0ed8e5917ba6223239/botorch/models/gp_regression_mixed.py#L36:L38) say that its kernel is of the form:
That makes sense. Based on the above I would expect the code to look something like:
However, the code https://github.com/pytorch/botorch/blob/98503e4db839dcf92e60fa0ed8e5917ba6223239/botorch/models/gp_regression_mixed.py#L152:L180 is a bit more complicated and I don't really understand why, nor can I see any consistent pattern. Namely, it does:
The most confusing part is that the
or
? Especially that both Matern and Categorical kernel have default output scale of [0, 1]. I'm happy to open a PR that fixes it, just not sure if it actually is an issue or I'm just missing something. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
In GPyTorch, the kernels do not have an output scale. The Onto the structure of the sum kernel: This is actually equivalent to
If you define I don't know why it was implemented one way vs the other. If I had to guess, I'd say that the current implementation produced better results during model training (they're equivalent in theory, but numerical optimization is another story...). |
Beta Was this translation helpful? Give feedback.
In GPyTorch, the kernels do not have an output scale. The
ScaleKernel
is used to add an output scale to any given kernel. So, that's where that bit comes into play.Onto the structure of the sum kernel: This is actually equivalent to
sum_kernel = ScaleKernel(MaternKernel(...)) + ScaleKernel(CategoricalKernel(...))
in theory. Since the output scale inScaleKernel
is a trained parameter, there isn't a difference between the two. The original readsIf you define
scale_3 = scale_1 * scale_2
, you …