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

What's the difference between BCEcls and BCEobj? #12

Closed
ShirleyHe2020 opened this issue Apr 14, 2021 · 1 comment
Closed

What's the difference between BCEcls and BCEobj? #12

ShirleyHe2020 opened this issue Apr 14, 2021 · 1 comment

Comments

@ShirleyHe2020
Copy link

class ComputeLoss:
# Compute losses
def init(self, model, autobalance=False):
super(ComputeLoss, self).init()
device = next(model.parameters()).device # get model device
h = model.hyp # hyperparameters

    # Define criteria
    BCEcls = nn.BCEWithLogitsLoss(pos_weight=torch.tensor([h['cls_pw']], device=device))
    BCEobj = nn.BCEWithLogitsLoss(pos_weight=torch.tensor([h['obj_pw']], device=device))
@Bobo-y
Copy link
Owner

Bobo-y commented Apr 15, 2021

BCEobj for object or background, when there is a object, BCEcls for object's class. You can review Yolo's design.

@Bobo-y Bobo-y closed this as completed Apr 15, 2021
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