fix: there may not be weight ratio in multilabel dataset label (#3227)
parent
1b99736b14
commit
d1634d4702
|
@ -39,7 +39,7 @@ class MultiLabelLoss(nn.Layer):
|
|||
def _binary_crossentropy(self, input, target, class_num):
|
||||
if self.weight_ratio:
|
||||
target, label_ratio = target[:, 0, :], target[:, 1, :]
|
||||
else:
|
||||
elif target.ndim == 3:
|
||||
target = target[:, 0, :]
|
||||
if self.epsilon is not None:
|
||||
target = self._labelsmoothing(target, class_num)
|
||||
|
|
Loading…
Reference in New Issue