elijahcole / single-positive-multi-label

Multi-Label Learning from Single Positive Labels - CVPR 2021
https://arxiv.org/abs/2106.09708
MIT License
89 stars 18 forks source link

Question about the label range. #6

Closed jingyang2017 closed 3 years ago

jingyang2017 commented 3 years ago

Hi, Elijah! Great work! After reading the source code, I have a question about the observed label's range in losses.py.

From my understanding, "label_vec_obs" is in {-1,1} and "label_vec_true" is in {0,1}. But for losses 'bce' and 'bce_ls' , 'train_set_variant' is set as 'clean' and their label_vec _obs is same as label_vec_true.

However, in 'losses.py' , line 35, 48, assert not torch.any(observed_labels == 0), line 134 assert torch.min(observed_labels) >= 0

Did I miss anything in observed label generating?

elijahcole commented 3 years ago

Good catch! You're absolutely right, it looks like that's a bug which crept in during refactoring. I just pushed a fix.