dgs.models.metric.metric.CosineSimilarityMetric

class dgs.models.metric.metric.CosineSimilarityMetric(*args: Any, **kwargs: Any)[source]

Class to compute the cosine similarity between two matrices.

Notes

The cosine similarity is defined as:

\[\text{cosine similarity} = S_C(A,B) = \frac{\mathbf{A} \cdot \mathbf{B}}{\|\mathbf{A}\| \|\mathbf{B}\|}\]
__init__(*args, **kwargs) None[source]

Methods

forward(input1, input2)

Due to the sheer size of the PoseTrack21 dataset, CosineSimilarity() does not work due to memory issues.