Stay organized with collections Save and categorize content based on your preferences.

View source on GitHub

Computes the lifted structured loss.

The loss encourages the positive distances (between a pair of embeddings with the same labels) to be smaller than any negative distances (between a pair of embeddings with different labels) in the mini-batch in a way that is differentiable with respect to the embedding vectors. See:

labels 1-D tf.int32 Tensor with shape [batch_size] of multiclass integer labels.
embeddings 2-D float Tensor of embedding vectors. Embeddings should not be l2 normalized.
margin Float, margin term in the loss definition.

lifted_loss tf.float32 scalar.