Open iacopomasi opened 8 years ago
Hi @iacopomasi ,
Actually the BatchTripletLossLayer
is an re-implementation of the FaceNet paper from Google:
FaceNet: A Unified Embedding for Face Recognition and Clustering
Florian Schroff, Dmitry Kalenichenko, James Philbin
The major differences between the MM paper and FaceNet is that the MM paper uses pre-generated triplets while FaceNet generating triplets from an batch at training time. In addition, FaceNet remove the triplets that are too hard for training, i.e. in which the distance between positive pair is larger than that between negative pair.
Hi @wanji, thanks for the clarification but it still not clear to me. Reading the post after a few months 😄 and looking into your code, it seems that here you have a trade-off between 2 losses:
rank_loss * mu_ + pair_loss * one_minus_mu;
The trade-off is governed by mu
parameter:
pair_loss
is unclear. Is pair_loss
the average distance of same-class pairs? smp_rank_loss
loss used somehow or just shown for debug? This seems the same as rank_loss
but computed on selected triplet, more closely to FaceNet paperThanks.
Hi @wanji , could you please clarify the loss that is minimized in
BatchTripletLossLayer
layer and point to a paper that is explaining it?In particular what is the
mu
parameter inIt looks like from the code that implements Scheme II in the paper you mentioned.
From the code seems that you re-implemented this this but I am not sure. I cannot find your parameters in that paper.
Thank you.