Siamese netwroks - how to choose loss function?
I have read several articles about siamese netwroks
, and I understand that there are 3 different types of loss functions:
Contrastive Loss
- Takes 2 inputs (from same or different classes)Triplet Loss
- Takes 3 inputs (Anchor, Positive, Negative).Quadruplet Loss
- Takes 4 inputs (Anchor, Positive, Negative1, Negative3).
- I didn't found any description about which loss function to use in each scenario ?
- How do I which loss function (Contrastive/Triplet/Quadruplet) to choose in the case I'm working on ?
- Are there any guidelines ?
Example:
- I have a bag of images (dataset of faces or dataset of cars) and I want to be able to get new image as input and show it's similar images (same person face or same car).
- I can use any of the 3 losses, but what will be the best to choose ?