Skip to content

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

Closed

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

Activity

  1. PenGuln commented on Jun 24, 2026

    @PenGuln
    Collaborator

    Thanks for the report! This was a typo — rm should be m. The fix has been applied in this commit and is available in v2.0.1.

    To get the updated code, please run:

    pip install -U libauc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions