Git Product home page Git Product logo

Comments (3)

szq0214 avatar szq0214 commented on September 27, 2024

Hi @Simon-Stma

Thanks for your interest in our work. It's easy to generalize UnMix to clustering-based methods like SwAV. You can simply consider replacing the soft distance of positive and negative pairs in contrastive loss with soft cluster assignment (i.e., soft fitness between features z and a code q) in SwAV. Specifically, in SwAV, there are similarly two image features $\mathbf z_t, \ \mathbf z_s$ from two different augmentations of the same image, the loss function of SwAV is:
$L_{ori}(\mathbf{z}_t, \mathbf{z}_s)=\ell(\mathbf{z}_t, \mathbf{q}_s)+\ell(\mathbf{z}_s, \mathbf{q}_t)$

where $\ell(\mathbf{z}_t, \mathbf{q}_s)=-\sum_k \mathbf{q}_s^{(k)} \log \mathbf{p}_t^{(k)}$

For UnMix on SwAV, we can also replace one of image feature with normal order of mixture and reverse order of mixture, i.e., $\mathbf z_t^m, \mathbf z^{rm}_t$ , then $L_M$ will be:
$L_M=\lambda L_M(\mathbf{z}^m_t, \mathbf{z}_s)+(1-\lambda)L_M(\mathbf{z}^{rm}_t, \mathbf{z}_s)=\lambda(\ell(\mathbf{z}^m_t, \mathbf{q}_s)+\ell(\mathbf{z}_s, \mathbf{q}^m_t))+(1-\lambda)(\ell(\mathbf{z}^{rm}_t, \mathbf{q}_s)+\ell(\mathbf{z}_s, \mathbf{q}^{rm}_t))$

The final objective is:
$L_{all}=L_{ori}(\mathbf{z}_t, \mathbf{z}_s)+\lambda L_M(\mathbf{z}^m_t, \mathbf{z}_s)+(1-\lambda)L_M(\mathbf{z}^{rm}_t, \mathbf{z}_s)$

from un-mix.

Simon-Stma avatar Simon-Stma commented on September 27, 2024

Thank you very much for your reply in your busy schedule! I understand what you mean。

from un-mix.

szq0214 avatar szq0214 commented on September 27, 2024

Hi @Simon-Stma We have released the code of Un-Mix + SwAV on CIFAR and ImageNet datasets: https://github.com/szq0214/Un-Mix/tree/master/UnMix_SwAV, you can have a look in this repo for the implementation.

from un-mix.

Related Issues (8)

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.