Skip to content

NameError: name 'rm' is not defined when using barrier_hinge surrogate in PairwiseAUCLoss #72

Description

@AmanKashyap0807

When attempting to use the barrier_hinge surrogate loss function inside PairwiseAUCLoss, the forward pass immediately crashes with a NameError because it attempts to reference an undefined variable rm.

Steps to reproduce:

import torch
from libauc.losses import PairwiseAUCLoss
loss_fn = PairwiseAUCLoss(surr_loss="barrier_hinge", hparam=(1.0, 1.0))
y_pred = torch.randn(10)
y_true = torch.tensor([1.0]*5 + [0.0]*5)
loss = loss_fn(y_pred, y_true)

Environment:
LibAUC Version: 2.0.0
PyTorch Version: 2.3.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions