Skip to content

Commit 26f5ab4

Browse files
committed
ensemble: correct confidence val calculation
- confidence=2×∣x−0.5∣
1 parent 82a96dc commit 26f5ab4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

chebai/models/ensemble.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ def forward(self, data: Dict[str, Tensor], **kwargs: Any) -> Dict[str, Any]:
199199
prediction = torch.full_like(total_logits, -1, dtype=torch.bool)
200200
confidence = torch.full_like(total_logits, -1, dtype=torch.float)
201201
prediction[:, mask] = sigmoid_logits > 0.5
202-
confidence[:, mask] = sigmoid_logits
202+
confidence[:, mask] = 2 * torch.abs(sigmoid_logits - 0.5)
203203

204204
predictions[name] = prediction
205205
confidences[name] = confidence

0 commit comments

Comments
 (0)