fedelopez77 / sympa

Embedding graphs in symmetric spaces
28 stars 8 forks source link

Issues with generating embeddings for different product type manifolds #4

Closed sanchit-ahuja closed 2 years ago

sanchit-ahuja commented 2 years ago

Hi, I have been able to generate graph embeddings for my normal 2D graph with unitary weight for euclidean, poincare, lorentz and sphere manifolds but unable to do so for product type manifolds. I get the below error for prod-hyhy and prod-hyeu manifolds:

error: The last dimension should be equal to 2, but got 3

And this for prod-hysph: ValueError: Manifold only consists of isolated points when subspace is 1-dimensional.

This is my custom graph:

2 0 1
3 0 1
4 0 1
5 0 1
6 0 1
7 0 1
8 0 1
9 0 1
10 0 1
11 0 1
12 0 1
13 0 1

Should I remove the weight dimension from the graph for it to make it work? If yes, do the embeddings keep the unitary weight in mind while calculating the embeddings? Thanks a lot for all your help!

fedelopez77 commented 2 years ago

I think that the error is unrelated to your weight file. It has to do with the number of dimensions you are setting for the embeddings. For products of manifolds, usually it is better to set an even value (dim % 2 == 0).

sanchit-ahuja commented 2 years ago

I am preprocessing a custom list of graphs. Is there a dim argument for the custom graph as well? And how do we know which value to set for the graph? For example, what will be the value of dim for the above graph?

sanchit-ahuja commented 2 years ago

@fedelopez77 Anything regarding the above?

fedelopez77 commented 2 years ago

Not sure that I follow what you mean. You can learn graph embeddings of any chosen dimensionality for any input graph. Depending on the structure of the graph, in some cases, you will need higher dimensions to achieve accurate embeddings. For simple graphs, probably 2, 3, or 4 dims might be enough.

sanchit-ahuja commented 2 years ago

How do we set the dimensionality of the custom graph? Do we use the DIMS flag here as well?

sanchit-ahuja commented 2 years ago

The above issue is fixed. I had to use the dims dimension for training to gather embeddings. Thanks!