nayeemrizve / ups

"In Defense of Pseudo-Labeling: An Uncertainty-Aware Pseudo-label Selection Framework for Semi-Supervised Learning" by Mamshad Nayeem Rizve, Kevin Duarte, Yogesh S Rawat, Mubarak Shah (ICLR 2021)
MIT License
231 stars 40 forks source link

QUESTION OF YOUR CODE #7

Closed ghost closed 3 years ago

ghost commented 3 years ago

Hi,

Thanks for the share.

Based on your equation 3,

Screen Shot 2021-07-06 at 9 42 09 am

The tilde y in here is the pre-generated hard pseudo label, and y hat is the model prediction. However, according to your code in here,

            y_nl = torch.ones((nl_logits.shape)).to(device=args.device, dtype=logits.dtype)
            loss_nl += torch.mean((-torch.sum((y_nl * torch.log(pred_nl))*nl_mask, dim = -1))/(torch.sum(nl_mask, dim = -1) + 1e-7))

it looks like you only multiply the log(1- y hat) with the 1, instead of the (1-y tilde).

Do I miss something?

Cheers,