How to train triplet loss based model from scratch?

Just curious about it. For example how to organize the input X and output label Y. In the course I just mentioned that we shall prepare: [A]nchor, [P]ositive, [N]egative.

As I understand, correct me if I am wrong:

X: A, P, N
Y: <-------- What is Y which provides Y_True :man_shrugging:t2:
Loss: triplet_loss(Y_True, Y_Pred_P, Y_Pred_Y)

Hi Chris.X,

Great question.

A way to organize this is described here.

It boils down to placing anchors and positives of one person’s face in a folder together, with negatives constituted by anchors and positives of another person’s face in another folder. Then, during training, images selected from the same folder go into calculations of f(A) and f(P) while a negative image from another folder goes into f(N). This way, the cost can be calculated and parameters can be calibrated through backpropagation.