Giter VIP home page Giter VIP logo

Comments (6)

Rizhiy avatar Rizhiy commented on September 2, 2024

You need to write a new loss, similar to the one reid/loss/triplet.py and use that instead. Usually, you can just add losses together, just make sure to scale them since softmax can be much larger than triplet.

You would probably need to write your own data loader since softmax and triplet use different sampling techniques.

from open-reid.

Cysu avatar Cysu commented on September 2, 2024

@Rizhiy Thank you very much for the answer!

from open-reid.

wang5566 avatar wang5566 commented on September 2, 2024

@Rizhiy Thank you for your reply. But how to scale this two loss? In my network, I got softmax loss 1.5 and triplet loss 1.27, seeming unusual.

from open-reid.

Rizhiy avatar Rizhiy commented on September 2, 2024

To be honest I have never tried to train a network with multi-loss. Perhaps train softmax and triplet loss separately first, then calculate the scale such that they become the same value.

from open-reid.

zydou avatar zydou commented on September 2, 2024

You can add a parameter to control the balance between them.
For example:

loss = loss1 + lambda * loss2 

from open-reid.

Cysu avatar Cysu commented on September 2, 2024

@Rizhiy @zydou Thanks a lot for your answers!

from open-reid.

Related Issues (20)

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.