Skip to content

FixMatch for single class #3

Open
@dendrobiumz

Description

@dendrobiumz

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions