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

fix bootstrapped cross entropy bug #806

Merged
merged 8 commits into from
Jan 27, 2021
3 changes: 2 additions & 1 deletion paddleseg/models/losses/bootstrapped_cross_entropy.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ def __init__(self, min_K, loss_th, weight=None, ignore_index=255):
self.ignore_index = ignore_index
self.K = min_K
self.threshold = loss_th
if weight is not None:
weight = paddle.to_tensor(weight, dtype='float32')
self.weight = weight
self.ignore_index = ignore_index

def forward(self, logit, label):

Expand Down