You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I am learning how to use the approximate GP in gpytorch. And while doing the example, I can accross the expected_log_prob function in Gaussian likelihood:
`def expected_log_prob(self, target: Tensor, input: MultivariateNormal, *params: Any, **kwargs: Any) -> Tensor:
mean, variance = input.mean, input.variance
num_event_dim = len(input.event_shape)
noise = self._shaped_noise_covar(mean.shape, *params, **kwargs).diagonal(dim1=-1, dim2=-2)
# Potentially reshape the noise to deal with the multitask case
noise = noise.view(*noise.shape[:-1], *input.event_shape)
res = ((target - mean).square() + variance) / noise + noise.log() + math.log(2 * math.pi)
res = res.mul(-0.5)
if num_event_dim > 1: # Do appropriate summation for multitask Gaussian likelihoods
res = res.sum(list(range(-1, -num_event_dim, -1)))
return res`
The code suggests that the variance is added to the difference term and not with the noise term. Considering a homoscedastic noise, I thought that the variance should be in the Covariance matrix along with the diagonal noise matrix. So taking the log prob of the MVN
the code should be something like:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
I am learning how to use the approximate GP in gpytorch. And while doing the example, I can accross the expected_log_prob function in Gaussian likelihood:
`def expected_log_prob(self, target: Tensor, input: MultivariateNormal, *params: Any, **kwargs: Any) -> Tensor:
mean, variance = input.mean, input.variance
num_event_dim = len(input.event_shape)
The code suggests that the variance is added to the difference term and not with the noise term. Considering a homoscedastic noise, I thought that the variance should be in the Covariance matrix along with the diagonal noise matrix. So taking the log prob of the MVN
the code should be something like:
res = ((target - mean).square() / (noise +variance) + (variance+noise).log() + math.log(2 * math.pi)
Can someone please help me understand this, what is happening here?
Beta Was this translation helpful? Give feedback.
All reactions