Git Product home page Git Product logo

bnm's Introduction

Code Release for BNM v1 v2

Papers

BNM v1 Towards Discriminability and Diversity: Batch Nuclear-norm Maximization under Label Insufficient Situations (CVPR2020 oral)

BNM v2 Fast Batch Nuclear-norm Maximization and Minimization for Robust Domain Adaptation (TPAMI under review)

Clean code of BNM v1 can be found in old version

One-sentence description

BNM v1: we prove in the paper that Batch Nuclear-norm Maximization (BNM) can ensure the prediction discriminability and diversity, which is an effective method under label insufficient situations.

BNM v2: we further devise Batch Nuclear-norm Minimization (BNMin) and Fast BNM (FBNM) for multiple domain adaptation scenarios.

Quick start with BNM

One line code for BNM v1 under Pytorch and Tensorflow

Assume X is the prediction matrix. We can calculate BNM loss in both Pytorch and Tensorflow, as follows:

-Pytorch

  1. Direct calculation (Since there remains direct approach for nuclear-norm in Pytorch)
L_BNM = -torch.norm(X,'nuc')
  1. Calculation with SVD (For S, V and D, only S is useful for calculation of BNM)
L_BNM = -torch.sum(torch.svd(X, compute_uv=False)[1])

-Tensorflow

L_BNM = -tf.reduce_sum(tf.svd(X, compute_uv=False))

Code for FBNM under Pytorch

Assume X is the prediction matrix. Then FBNM can be calculated as:

list_svd,_ = torch.sort(torch.sqrt(torch.sum(torch.pow(X,2),dim=0)), descending=True)
nums = min(X.shape[0],X.shape[1])
L_FBNM = - torch.sum(list_svd[:nums])

Sum of Changes from BNM v1 to BNM v2

    • FBNM.(By approximation)
    • BNMin.(On the other hand on source domain)
    • Multiple BNM.(Multiple Batch Optimization)
    • Semi-supervised DA.(New task)

Applications

We apply BNM to unsupervised domain adaptation (UDA) in DA, unsupervised open domain recognition (UODR) in UODR and semi-supervised learning (SSL) in SSL.

Training instructions for UDA, UODR and SSL are in the README.md in DA, UODR and SSL respectively.

Citation

If you use this code for your research, please consider citing:

@InProceedings{Cui_2020_CVPR,
author = {Cui, Shuhao and Wang, Shuhui and Zhuo, Junbao and Li, Liang and Huang, Qingming and Tian, Qi},
title = {Towards Discriminability and Diversity: Batch Nuclear-Norm Maximization Under Label Insufficient Situations},
booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
month = {June},
year = {2020}
}
@article{cui2021fast,
  title={Fast Batch Nuclear-norm Maximization and Minimization for Robust Domain Adaptation},
  author={Cui, Shuhao and Wang, Shuhui and Zhuo, Junbao and Li, Liang and Huang, Qingming and Tian, Qi},
  journal={arXiv preprint arXiv:2107.06154},
  year={2021}
}

Supplementary of BNM can be found in Google driver and baidu cloud (z7yt).

Supplementary of BNM2 can be found in Google driver and baidu cloud (hbqc).

Note

量子位

BNM v1

BNM v2

Contact

If you have any problem about our code, feel free to contact

or describe your problem in Issues.

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.