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

Added weighted BCE #705

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Added weighted BCE #705

wants to merge 3 commits into from

Conversation

EvgeniyS99
Copy link
Contributor

No description provided.




class WeightedBCE(nn.Module):
Copy link
Member

@AlexeyKozhevin AlexeyKozhevin Jul 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would think that weighted bce means that I can throw weights into it. It's rather BalancedWeightedBCE


losses = [WeightedBCE(), Dice()]
weights = [.5, .5]
comboloss = Weighted(losses, weights)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you really need it here? There is not a problem to make it in your notebook:

ComboLoss = Weighted([WeightedBCE(), Dice()], [.5, .5])

Nevertheless, comboloss here is inappropriate naming.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, ye, but I thought I should present the full loss used in my models

Copy link
Contributor Author

@EvgeniyS99 EvgeniyS99 Jul 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you really need it here? There is not a problem to make it in your notebook:

ComboLoss = Weighted([WeightedBCE(), Dice()], [.5, .5])

Nevertheless, comboloss here is inappropriate naming.

Why is comboloss inappropriate naming? The bce loss is combined with dice loss --> comboloss

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's unclear combination of what




class BalancedWeightedBCE(nn.Module):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CrossEntropyLoss from batchflow.models.torch.losses.core.py already can do all of that. Maybe, make inherit BCE / make it a special case of it somehow?

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

Successfully merging this pull request may close these issues.

3 participants