Shortcuts

quaterion.loss.group_loss module

class GroupLoss(distance_metric_name: Distance = Distance.COSINE)[source]

Bases: SimilarityLoss

Base class for group losses.

Parameters:

distance_metric_name – Name of the distance function, e.g., Distance.

forward(embeddings: Tensor, groups: LongTensor) Tensor[source]
Parameters:
  • embeddings – shape: (batch_size, vector_length)

  • groups – shape: (batch_size,) - Groups, associated with embeddings

Returns:

Tensor – zero-size tensor, loss value

training: bool

Qdrant

Learn more about Qdrant vector search project and ecosystem

Discover Qdrant

Similarity Learning

Explore practical problem solving with Similarity Learning

Learn Similarity Learning

Community

Find people dealing with similar problems and get answers to your questions

Join Community