CVIB-Rec icon indicating copy to clipboard operation
CVIB-Rec copied to clipboard

The info_loss is wrong

Open LDR-KDD opened this issue 3 years ago • 1 comments

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)

LDR-KDD avatar Mar 02 '21 12:03 LDR-KDD

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].

RyanWangZf avatar Mar 03 '21 10:03 RyanWangZf