dicee.models.sampled_loss

Reusable loss for positive-first groups of negative samples.

Functions

grouped_adversarial_bce(→ torch.Tensor)

Balance the positive against a weighted negative group (ULTRA convention).

Module Contents

dicee.models.sampled_loss.grouped_adversarial_bce(logits: torch.Tensor, targets: torch.Tensor, temperature: float) torch.Tensor[source]

Balance the positive against a weighted negative group (ULTRA convention).

Positive temperature uses detached softmax(logits / temperature); zero uses uniform negative weights. This intentionally differs from ordinary mean BCE.