metrics.pairwise.compute_ground_distances

pai4sk.metrics.pairwise.compute_ground_distances(W, use_gpu=True, use_cosine=False)

Computes pairwise distances between the vectors in W.

Parameters
  • W (ndarray, shape: (n_features, n_dimensions)) – Embedding vectors

  • use_gpu (boolean, when false uses the CPU, when true uses the GPU.) –

  • use_cosine (boolean, when false computes Euclidean ground distances between the embedding vectors,) – when true computes (1 - Cosine Similarity) after normalizing the embedding vectors.

Returns

D – Ground Distances between Embedding Vectors

Return type

array-like, shape (n_features, n_features)