muhanzhang / DGCNN

Code for "M. Zhang, Z. Cui, M. Neumann, and Y. Chen, An End-to-End Deep Learning Architecture for Graph Classification, AAAI-18".
MIT License
174 stars 44 forks source link

Can this model use batch gradient descent to optimization? #7

Closed Calemsy closed 5 years ago

Calemsy commented 5 years ago

Hi~ Some other details I want to know, and look forward to your reply. In the paper you said: For graphs with vertex labels or attributes, X can be the one-hot encoding matrix of the vertex labels or matrix of multidimensional vertex attributes. so if the graph with 3 nodes without any node attribute, the X can represent as follow:

np.eye(3) =
[[1, 0, 0], 
 [0, 1, 0], 
 [0, 0, 1]]

and X.shape = (n, c), and c exactly equal to n, right? if the answer is positive, what puzzle me is the dimension of W(W.shape = (c/n, c')) in the first graph convolution layer will with different size graph by graph, but the W are shared among all input. How to explain and deal with this?

Second, I noticed the optimization method you used to minimize the loss function is SGD with ADAM, what i want to know is whether we can't vectorization in this model, i.e. the batch_size only can be set to 1?

thanks sincerely!

muhanzhang commented 5 years ago

No. In your case, your nodes all have the same type. Thus c=1. You will have a matrix [1,1,1]^T as X.

You can set the batch_size by appending "-batch true -batchSize 16" for example.

Calemsy commented 5 years ago

Thanks for your reply.