Skip to content

[Question] How Likelihood is related to model.likelihood? #1783

Answered by patel-zeel
mohammad-saber asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @mohammad-saber,

Yes, you are correct that both of them are pointing to the same object. I suppose you are wondering how it is updated during training despite we do not do output = likelihood(model(train_x)) but instead we do output = model(train_x). Note that, we have already passed likelihood to the model definition in the following code block:

# We will use the simplest form of GP model, exact inference
class ExactGPModel(gpytorch.models.ExactGP):
    def __init__(self, train_x, train_y, likelihood):
        super(ExactGPModel, self).__init__(train_x, train_y, likelihood)
        self.mean_module = gpytorch.means.ConstantMean()
        self.covar_module = gpytorch.kernels.ScaleKerne…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mohammad-saber
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