Optimization-AI / LibAUC

LibAUC: A Deep Learning Library for X-Risk Optimization
https://libauc.org/
MIT License
273 stars 37 forks source link

APLoss RuntimeError #58

Closed s-rog closed 2 months ago

s-rog commented 2 months ago
  File "~/micromamba/envs/jpt/lib/python3.10/site-packages/libauc/losses/auc.py", line 313, in forward
    assert sum(pos_mask) > 0, "Input data has no positive sample! Please use 'libauc.sampler.DualSampler' for data resampling!"
RuntimeError: Boolean value of Tensor with more than one value is ambiguous

I'm trying to use this for a binary problem but have not been able to get it to work (torch 2.3). I looked into a code but couldn't find any glaring errors as sum(Tensor) should reduce pos_mask down to a single element...

Edit: Some of my input shapes were wrong