add infer loss for LuoXData with long data by clip & alignment data
This commit is contained in:
1 parent
386df9a4ab
commit
ded9b27f71
42 files changed
+1233
-1361
No files matched your search
@@ -53,6 +53,7 @@ def weight_reduce_loss(loss, weight=None, reduction='mean', avg_factor=None):
|
||||
# if reduction is 'none', then do nothing, otherwise raise an error
|
||||
elif reduction != 'none':
|
||||
raise ValueError('avg_factor can not be used with reduction="sum"')
|
||||
|
||||
return loss
|
||||
|
||||
|
||||
|
||||
@@ -47,17 +47,15 @@ class WingLoss(nn.Module):
|
||||
avg_factor(int, optional): The average of the reduction loss
|
||||
"""
|
||||
|
||||
loss = wing_loss(pred, target, w=self.w, epsilon=self.epsilon, weight=weight, avg_factor=avg_factor)
|
||||
loss = wing_loss(pred, target, w=self.w, epsilon=self.epsilon, weight=weight, reduction=self.reduction, avg_factor=avg_factor)
|
||||
loss = self.loss_weight * loss
|
||||
|
||||
|
||||
|
||||
return loss
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
crieation = WingLoss()
|
||||
|
||||
|
||||
Reference in new issue
Block a user