xbresson / spectral_graph_convnets Goto Github PK
View Code? Open in Web Editor NEWPyTorch implementation of spectral graph ConvNets, NeurIPS’16
License: MIT License
PyTorch implementation of spectral graph ConvNets, NeurIPS’16
License: MIT License
I am getting the following error. Can you please help?
File "full_gcn.py", line 365, in
loss_train = loss.data[0]
IndexError: invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python number
Hello,
l would like to know whether your code extends to irregular graph structure , such that :
number of edges is variable (rather than number_edges = 8) and the graph is not a grid but an irregular graph (variable number of nodes and vertices. In your MNIST example you set grid_side = 28)
Thank you
To rescale Laplacian eigenvalues to [-1, 1], the formula should be
I think the 33-th line in corsening.py should be like follows:
L /= lmax / 2
Hello @xbresson ,
Let me first thank for this work.
l went through your implementation. Hence , l have some question :
1- You set coarsening_levels = 4, however only L[0] and L[2] are used
x = self.graph_conv_cheby(x, self.cl1, L[0], lmax[0], self.CL1_F, self.CL1_K)
and
x = self.graph_conv_cheby(x, self.cl2, L[2], lmax[2], self.CL2_F, self.CL2_K)
What about L[1],L[3] and L[4] ?
2- Why lmax[0] and lmax[2] are recalculated in graph_conv_cheby . Even if lmax is a parameter input of this function.
3- Do you mind explaining why your rescale Laplacian eigenvalues to [-1,1] ?
rescale_L(L, lmax)
4- concat(x,x_) is not ued at all in graph_conv_cheby() :
def concat(x, x_):
x_ = x_.unsqueeze(0) # 1 x V x Fin*B
return torch.cat((x, x_), 0) # K x V x Fin*B
5- What if K=1 in graph_conv_cheby() ?
l noticed that at least K should equal 2.
How can l use that just for K=1 ?
Thank you for your consideration
Hello @xbresson ,
Thank you for your work and for making available pytorch version of GCN.
I have question relate to graph_conv_cheby(self, x, cl, L, lmax, Fout, K)
function (https://github.com/xbresson/spectral_graph_convnets/blob/master/02_graph_convnet_lenet5_mnist_pytorch.ipynb)
x = cl(x)
after the Chebyshev multiplications ?
if K > 1:
x1 = my_sparse_mm()(L,x0) # V x Fin*B
x = torch.cat((x, x1.unsqueeze(0)),0) # 2 x V x Fin*B
for k in range(2, K):
x2 = 2 * my_sparse_mm()(L,x1) - x0
x = torch.cat((x, x2.unsqueeze(0)),0) # M x Fin*B
x0, x1 = x1, x2
x = x.view([K, V, Fin, B]) # K x V x Fin x B
x = x.permute(3,1,2,0).contiguous() # B x V x Fin x K
x = x.view([B*V, Fin*K])
?
Thank you a lot for your answer
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.