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

Why is SAF loss negative,FreeMatch #231

Open
yumudry opened this issue Sep 25, 2024 · 0 comments
Open

Why is SAF loss negative,FreeMatch #231

yumudry opened this issue Sep 25, 2024 · 0 comments

Comments

@yumudry
Copy link

yumudry commented Sep 25, 2024

   # calculate entropy loss
        if mask.sum() > 0:
           ent_loss, _ = entropy_loss(mask, logits_x_ulb_s, self.p_model, self.label_hist)
        else:
           ent_loss = 0.0
        # ent_loss = 0.0
        total_loss = sup_loss + self.lambda_u * unsup_loss + self.lambda_e * ent_loss

    out_dict = self.process_out_dict(loss=total_loss, feat=feat_dict)
    log_dict = self.process_log_dict(sup_loss=sup_loss.item(), 
                                     unsup_loss=unsup_loss.item(), 
                                     ent_loss=ent_loss.item(),
                                     total_loss=total_loss.item(), 
                                     util_ratio=mask.float().mean().item())
   ent_loss=ent_loss.item()             

Ent_ross, I printed this loss value and it's all negative
image

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

1 participant