Loss: 
We learn \(f_\text{rel}\)  using contrastive losses, which have been used to learn continuous embeddings from high dimensional data [1]}, [2]}, [3]}, [4]}.
Contrastive losses are useful for our formulation since they compare sample similarity directly in the representation space.
Amongst the multiple contrastive loss formulations we use the triplet loss [1]}.
Formally, the triplet loss requires an anchor \((a)\)  and positive \((p)\)  - negative \((n)\)  pairs. The aim is to keep the anchor and positive samples together while pushing the negative sample away based on a margin, \(L_{\text{triplet}} = (d_{ap} - d_{an} + \gamma )_{+}\)  where \(d_{ap}\)  and \(d_{an}\)  are the squared euclidean distance between the anchor and positive embedding, and anchor and negative embedding respectively. \(\gamma \)  is a constant margin between similar and dissimilar pairs.
