Giter VIP home page Giter VIP logo

Comments (2)

omoindrot avatar omoindrot commented on May 26, 2024 21

With the batch all strategy, since we only take the average loss over the semi-hard and hard triplets it's totally normal that the loss doesn't decrease.

However if the loss gets stuck at exactly the margin (0.5), it indicates that all the embeddings are collapsed into a single point. One solution is to reduce the learning rate until training does not collapse.

In your case I'm not sure what happens, maybe try to decrease the learning rate even further and see if you can get out of this collapsing behavior (with the batch all strategy)?

Also my code currently only works because MNIST has only 10 classes. The model currently receives batches with random images. As I have 64 images in a batch and 10 classes, I have a lot of triplets to work with. However in your case you have 3000 classes so there is only a small probability that you will get informative triplets in a batch of size 64.

The solution is to create your own batches (for instance 16 different classes with 4 images each for a total batch size of 64) and feed them to the model.

Edit: adding issue to track progress on this in #7

from tensorflow-triplet-loss.

demianzhang avatar demianzhang commented on May 26, 2024

Thanks for your reply.

from tensorflow-triplet-loss.

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.