question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Source on BalancedBCEWithLogitsLoss

See original GitHub issue

I was wondering if there is a paper or even just a description on the BalancedBCEWithLogitsLoss ?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
BloodAxecommented, Sep 27, 2021

The gamma is a my addition to this loss, when gamma=1, it’s equal to vanilla BBCE as in Formula 2. Values >1 decay the balancing weights. E.g if gamma = 2, and positives fraction is 0.25 and negatives is 0.75, corresponding weights will be 0.25^2 and 0.75^ accordingly.

1reaction
BloodAxecommented, Sep 27, 2021

Hi! Indeed, there are. See https://arxiv.org/pdf/1504.06375.pdf formula 2. Will update the code for the future release with proper docs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

BCEWithLogitsLoss — PyTorch 1.13 documentation
This loss combines a Sigmoid layer and the BCELoss in one single class. This version is more numerically stable than using a plain...
Read more >
About weight in BCEWithLogitsLoss to handle imbalanced ...
The "weight" parameter in BCEWithLogitsLoss do the same effort (balance imbalance sample) as the one in CrossEntropLoss's, right?
Read more >
Understanding pos_weight argument in BCEWithLogitsLoss
Obtaining the weights in this way results in a 'balanced' dataset where ideally you optimize for both precision and recall.
Read more >
How to use class weights in loss function for imbalanced dataset
Hello guys! I have an imbalanced dataset and I need to use class weights in the loss function. What is the correct way...
Read more >
[Class Imbalance]->Weighted Binary Cross Entropy - Kaggle
This way, we will be balancing the contribution of positive and negative ... This Notebook has been released under the Apache 2.0 open...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found