graphwave icon indicating copy to clipboard operation
graphwave copied to clipboard

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

Open sgrady3 opened this issue 6 years ago • 6 comments

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

sgrady3 avatar Jun 14 '18 04:06 sgrady3

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!

donnate avatar Jun 14 '18 07:06 donnate

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?

sgrady3 avatar Jun 14 '18 21:06 sgrady3

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!

donnate avatar Jun 14 '18 21:06 donnate

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?

sgrady3 avatar Jun 14 '18 23:06 sgrady3

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

  • the 2 comes from the fact that we have a real and imaginary part,
  • nb_timepoints is the number of time points that you use to sample along the parametric curve induced by each characteristic function
  • and nb_scales is the number of different scales that you stack up in your multi-resolution signature.

donnate avatar Jun 15 '18 00:06 donnate

Okay, that clears up a lot. Thank you!

sgrady3 avatar Jun 15 '18 19:06 sgrady3