Coder Social home page Coder Social logo

libauc's Introduction


LibAUC: A Deep Learning Library for X-Risk Optimization

Pypi Downloads python PyTorch LICENSE

| Documentation | Installation | Website | Tutorial | Research | Github |

News

  • [2024/04/07]: Bugs fixed: We fixed a bug in datasets/folder.py by returning a return_index to support SogCLR/iSogCLR for contrastive learning. Fixed incorrect communication with all_gather in GCLoss_v1 and set gamma to original value when u is not 0. None of these were in our experimental code of the paper.
  • [2024/02/11]: A Bug fixed: We fixed a bug in the calculation of AUCM loss and MultiLabelAUCM loss (the margin parameter is missed in the original calculation which might cause the loss to be negative). However, it does not affect the learning as the updates are not affected by this. Both the source code and pip install are updated.
  • [2023/06/10]: LibAUC 1.3.0 is now available! In this update, we have made improvements and introduced new features. We also release a new documentation website at https://docs.libauc.org/. Please see the release notes for details.
  • [2023/06/10]: We value your thoughts and feedback! Please consider filling out this brief survey to guide our future developments. Thank you!

Why LibAUC?

LibAUC offers an easier way to directly optimize commonly-used performance measures and losses with user-friendly API. LibAUC has broad applications in AI for tackling many challenges, such as Classification of Imbalanced Data (CID), Learning to Rank (LTR), and Contrastive Learning of Representation (CLR). LibAUC provides a unified framework to abstract the optimization of many compositional loss functions, including surrogate losses for AUROC, AUPRC/AP, and partial AUROC that are suitable for CID, surrogate losses for NDCG, top-K NDCG, and listwise losses that are used in LTR, and global contrastive losses for CLR. Here’s an overview:

Installation

Installing from pip

$ pip install -U libauc

Installing from source

$ git clone https://github.com/Optimization-AI/LibAUC.git
$ cd LibAUC
$ pip install .

For more details, please check the latest release note.

Usage

Example training pipline for optimizing X-risk (e.g., AUROC)

>>> #import our loss and optimizer
>>> from libauc.losses import AUCMLoss 
>>> from libauc.optimizers import PESG 
>>> #pretraining your model through supervised learning or self-supervised learning
>>> #load a pretrained encoder and random initialize the last linear layer 
>>> #define loss & optimizer
>>> Loss = AUCMLoss()
>>> optimizer = PESG()
... 
>>> #training
>>> model.train()    
>>> for data, targets in trainloader:
>>>	data, targets  = data.cuda(), targets.cuda()
        logits = model(data)
	preds = torch.sigmoid(logits)
        loss = Loss(preds, targets) 
        optimizer.zero_grad()
        loss.backward()
        optimizer.step()
...	
>>> #update internal parameters
>>> optimizer.update_regularizer()

Tutorials

X-Risk Minimization

Other Applications

Citation

If you find LibAUC useful in your work, please cite the following papers:

@inproceedings{yuan2023libauc,
	title={LibAUC: A Deep Learning Library for X-Risk Optimization},
	author={Zhuoning Yuan and Dixian Zhu and Zi-Hao Qiu and Gang Li and Xuanhui Wang and Tianbao Yang},
	booktitle={29th SIGKDD Conference on Knowledge Discovery and Data Mining},
	year={2023}
	}
@article{yang2022algorithmic,
   title={Algorithmic Foundations of Empirical X-Risk Minimization},
   author={Yang, Tianbao},
   journal={arXiv preprint arXiv:2206.00439},
   year={2022}
}

Contact

For any technical questions, please open a new issue in the Github. If you have any other questions, please contact us @ Zhuoning Yuan [[email protected]] and Tianbao Yang [[email protected]].

libauc's People

Contributors

yzhuoning avatar optmai avatar ganglii avatar xywei00 avatar penguln avatar zhqiu avatar dixianzhu avatar qiqi-helloworld avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.