Objectives based on the triplet loss take a similar form [1]}, [2]}, [3]}, [4]}, with the contrasting set \(\mathcal {N}( x )\)  comprising one or more negative samples, typically chosen based on some form of negative mining.
Most such objectives enforce an explicit margin, i.e., for \(\gamma > 0\) ,
\( \Omega _{\rm trip}( x ) \stackrel{.}{=}\mathbb {E}_{x^+, x^-} [ \gamma + \Phi ( x )^\top \Phi ( x^-) - \Phi ( x )^\top \Phi ( x^+) ]_+. \) 
