fix: use epsilon in cbc competition

This commit is contained in:
Alexander Engelsberger 2022-05-17 11:56:43 +02:00
parent 2a85c94b55
commit 339316aa7e
No known key found for this signature in database
GPG Key ID: 72E54A9DAE51EB96

View File

@ -38,7 +38,7 @@ def cbcc(detections: torch.Tensor, reasonings: torch.Tensor):
pk = A
nk = (1 - A) * B
numerator = (detections @ (pk - nk).T) + nk.sum(1)
probs = numerator / (pk + nk).sum(1)
probs = numerator / ((pk + nk).sum(1) + 1e-8)
return probs