Giter Site home page Giter Site logo

Comments (3)

happynear avatar happynear commented on August 22, 2024

Because I have came across difficulty when reproducing DeepID2. It optimize the softmax loss and contrastive loss simultaneously. I must add an additional label layer to tell contrastive loss whether the two samples are the same/different class. It is stupid.

Then I modified the contrastive layer to determine the same/different class by itself. With my implementation, I just need two usual data layers created by convert_imageset.exe, where 'usual' means a data blob and its corresponding label blob. No need to write program to create the weird data db as in siamese network example.

Here (https://github.com/happynear/FaceVerification/blob/master/caffe_proto/mnist_siamese_train_test.prototxt) is an example of how to use my contrastive layer. I think it is the best way for using the contrastive layer. All I need is to ensure the two image list files are mutually correspond to each other.

from caffe-windows.

d4nst avatar d4nst commented on August 22, 2024

Thanks for the clarification. I am about to start using Caffe for a face verification project, so I might be using it in the same way as you do. I will keep an eye to your other repo as well since I am very interested on reproducing DeepID/CASIA/DeepFace results.

In any case, don't you think that it would be better to have two different contrastive loss layers, one with the original implementation and another one with your custom implementation? In this way, the original siamese network example would still work.

from caffe-windows.

happynear avatar happynear commented on August 22, 2024

I would rather to write a new example to introduce my contrastive layer. The usage of the original siamese network is really weird. Not only for the contrastive loss layer, but also for its two-way network definition. You can find that I used the concat_layer to combine the two-way network together. I think this is the right way to realize siamese network, too.

from caffe-windows.

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.