tfa.losses.lifted_struct_loss

View source on GitHub

Computes the lifted structured loss.

Aliases:

tfa.losses.lifted_struct_loss(
    labels,
    embeddings,
    margin=1.0
)

Args:

  • 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.

Returns:

  • lifted_loss: tf.float32 scalar.