cvxgrp / pymde

Minimum-distortion embedding with PyTorch
https://pymde.org
Apache License 2.0
538 stars 27 forks source link

Embedding quality #81

Open drei34 opened 3 months ago

drei34 commented 3 months ago

Hi,

I am looking into embedding quality and a bit confused by the behavior. I did a preserve_distances on a graph and am computing quality metrics when I use the embedding and cosine similarity. From what I see, this is doing pretty well as 1-hop neighbors are at the front, then 2-hop, etc. However, I am not sure if this makes total sense. I take the object mde.X and then normalize so each embedding has L2 norm 1 so I can use cosine similarity. Using this, the results look good but if I don't normalize this is not the case. However, as I understand it, the default settings use squared norm to try and get two embeddings to be the same as the shortest path distance. Is this true? Why would normalizing like above lead to much better answers than if you don't normalize bc the embeddings in the optimization are not normalized. Should you always work with L2 normalized embeddings? Thank you! I guess what I am also asking is just a validation of my understanding of the objective function ...