Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FixMatch for single class #3

Open
dendrobiumz opened this issue Aug 1, 2020 · 1 comment
Open

FixMatch for single class #3

dendrobiumz opened this issue Aug 1, 2020 · 1 comment

Comments

@dendrobiumz
Copy link

I try to apply FixMatch on one class data.
For the unsupervised loss part, I modified the code like that.

self.uce_loss   = torch.nn.BCEWithLogitsLoss(reduction='none')
with torch.no_grad():
    woutputs = self.model(weak_u)
    woutputs = torh.sigmoid(woutput)
      
           
mask = woutputs .ge(self.threshold).float()
soutputs = self.model(strong_u)
uloss  = torch.mean(mask* self.uce_loss(soutputs, mask) )

Is that correct?

@iBelieveCJM
Copy link
Owner

It seems ok. Running your code is the best way to check it. Then I advised you to verify the effectiveness of the data augmentation on your data. The data augmentation plays the important role.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants