snap-stanford / graphwave

169 stars 53 forks source link

AttributeError: 'Heat' object has no attribute 'analysis' #7

Open sgrady3 opened 6 years ago

sgrady3 commented 6 years ago

I've been trying to use the graphwave function and there seems to be a bug. When I run the function graphwave on a networkx graph I get the error mentioned in the title: AttributeError: 'Heat' object has no attribute 'analysis' I've tracked this to the file heat_diffusion.py line 53: Sf_vec = Hk.analysis(np.eye(n_nodes))

I looked that the pygsp filter class documentation for a function called analysis but only found analyze. When trying to replace analysis with analyze in heat_diffusion.py line 53 I get an index range error so I don't think this is the fix.

I hope this helps, I'm very interested in using this technique and would like to be able to use this code.

-Thank you

donnate commented 6 years ago

Hi,

Thank you for picking up this mistake. This is due to an update in the pygsp Library. I have fixed this and made the code independent from pygsp (all you now need is numpy, scipy, pandas and networkx). Please let me know if you encounter further issues!

sgrady3 commented 6 years ago

Thank you! I do have one question. The current implementation of graphwave_alg as an argument for a list of time points. Do you have an intuition for what would be a good selection of time points?

donnate commented 6 years ago

Hi,

For the list of time points, I typically used 25 evenly spaced points in 0:100 (np.linspace(0,100,25)). In order to "guide" the choice of the range and number of samples, I found it useful to plot a few parametric curve induced by the characteristic functions, and visually assess if they are all clamped together, etc. This gives you a way to assess visually the amount of signal in the embeddings. Hope this helps! Do let me know if you have any additional issues!

sgrady3 commented 6 years ago

Great, thank you the advice. I do have one other question. I saw in the paper that the embeddings are independent of graph size. Are the embeddings always of size 700?

donnate commented 6 years ago

Hi, No, the embedding size varies: each node structural embedding is of size equal to: 2 x nb_timepoints x nb_scales where:

sgrady3 commented 6 years ago

Okay, that clears up a lot. Thank you!