How do I implement the Triplet Loss in Keras?
<p>I'm trying to implement Google's Facenet paper:</p>

<p><img src="https://i.stack.imgur.com/RT3TZ.png" alt="enter image description here"></p>

<p>First of all, is it possible to implement this paper using the Sequential API of Keras or should I go for the Graph API? </p>

<p>In either case, could you please tell me how do I pass the custom loss function <code>tripletLoss</code> to the model compile and how do I receive the <code>anchor embedding</code>, <code>positive embedding</code> and the <code>negative embedding</code> as parameters to calculate the loss? </p>

<p>Also, what should be the second parameter Y in model.fit(), I do not have any in this case...</p>