BalancedMSE
BalancedMSE copied to clipboard
about GAILoss
Thank you for your work.
gmm = {k: gmm[k].reshape(1, -1).expand(pred.shape[0], -1) for k in gmm}
mse_term = F.mse_loss(pred, target, reduction='none') / 2 / noise_var + 0.5 * noise_var.log()
sum_var = gmm['variances'] + noise_var
balancing_term = - 0.5 * sum_var.log() - 0.5 * (pred - gmm['means']).pow(2) / sum_var + gmm['weights'].log()
balancing_term = torch.logsumexp(balancing_term, dim=-1, keepdim=True)
when I use gai loss, my pred size is [128], but the data of gmm is [128, 8] after expand. How I solve this, looking forward to your recovery
I tried this:
is this work? when I use this,model training fails to converge
Sorry for the late reply. You may try adding a new dimension to pred by pred = pred.unsqueeze(-1)
.
@luxianlebron, I also met the same problem. Did you find the way to let model converge?