CVIB-Rec
CVIB-Rec copied to clipboard
The info_loss is wrong
Thank you for sharing the code.
However the info_loss in your methods can not match your paper and I think it is wrong.
info_loss = self.alpha * torch.mean(-pred_ul * logp_hat - (1 - pred_ul) * logp_hat) + self.gamma* torch.mean(pred * logp_hat)
The Info_loss in fact does not use the counterfactual pred_ul since it just equals
self.alpha * torch.mean(-logp_hat) + self.gamma* torch.mean(pred * logp_hat)
Based on your paper, I think the Info_loss should be
info_loss = self.alpha * torch.mean(-pred * logp_hat +pred * pred_ul.log() ) + self.gamma* torch.mean(pred * logp_hat)
Hi there, thank you very much for your notice.
Based on the paper, I think the write formula would be
pred_avg = pred.mean()
pred_ul_avg = pred_ul.mean()
info_loss = self.alpha * (- pred_avg * pred_ul_avg.log() - (1-pred_avg) * (1-pred_ul_avg).log()) + self.gamma* torch.mean(pred * logp_hat)
by which the result of MF_CVIB on COAT would reach around 0.75 AUC when alpha is set between [1,10].