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}\|}\]