Skip to content

Commit

Permalink
fix bootstrapped cross entropy bug (PaddlePaddle#806)
Browse files Browse the repository at this point in the history
  • Loading branch information
LutaoChu authored Jan 27, 2021
1 parent f850954 commit a4f7645
Showing 1 changed file with 2 additions and 1 deletion.
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

0 comments on commit a4f7645

Please sign in to comment.