soft_tversky_score doesn't use abs
In soft_tversky_score implementation,
```
if dims is not None:
output_sum = torch.sum(output, dim=dims)
target_sum = torch.sum(target, dim=dims)
difference = LA.vector_norm(output - target, ord=1, dim=dims)
else:
output_sum = torch.sum(output)
target_sum = torch.sum(target)
difference = LA.vector_norm(output - target, ord=1)
```
according to the reference paper https://arxiv.org/pdf/2302.05666, shouldn't we use L1-norm instead of only summation? We can change the lines to
```
output_sum = output.abs().sum(dim=dims)
target_sum = target.abs().sum(dim=dims)
difference = torch.linalg.vector_norm(output - target, ord=1, dim=dims)
```
<img width="815" height="186" alt="Image" src="https://github.com/user-attachments/assets/52691ac3-53af-43b8-9a72-9bf4b47c7731" />
关闭于 2025-12-23 2 条评论