Hi, when training the deear program, the train_loss is negative, and the value is train_loss: -1.537808895111084,
It seems something wrong, the loss_fn return -torch.mean(likelood) is that right? loss_fn in below:
def loss_fn(mu: Variable, sigma: Variable, labels: Variable):
'''
Compute using gaussian the log-likehood which needs to be maximized. Ignore time steps where labels are missing.
Args:
mu: (Variable) dimension [batch_size] - estimated mean at time step t
sigma: (Variable) dimension [batch_size] - estimated standard deviation at time step t
labels: (Variable) dimension [batch_size] z_t
Returns:
loss: (Variable) average log-likelihood loss across the batch
'''
zero_index = (labels != 0)
distribution = torch.distributions.normal.Normal(mu[zero_index], sigma[zero_index])
likelihood = distribution.log_prob(labels[zero_index])
return -torch.mean(likelihood)
thx,
james
Hi, when training the deear program, the train_loss is negative, and the value is train_loss: -1.537808895111084,
It seems something wrong, the loss_fn return -torch.mean(likelood) is that right? loss_fn in below:
def loss_fn(mu: Variable, sigma: Variable, labels: Variable):
'''
Compute using gaussian the log-likehood which needs to be maximized. Ignore time steps where labels are missing.
Args:
mu: (Variable) dimension [batch_size] - estimated mean at time step t
sigma: (Variable) dimension [batch_size] - estimated standard deviation at time step t
labels: (Variable) dimension [batch_size] z_t
Returns:
loss: (Variable) average log-likelihood loss across the batch
'''
zero_index = (labels != 0)
distribution = torch.distributions.normal.Normal(mu[zero_index], sigma[zero_index])
likelihood = distribution.log_prob(labels[zero_index])
return -torch.mean(likelihood)
thx,
james