mys007 / ecc

Edge-Conditioned Convolutions on Graphs
228 stars 48 forks source link

MNIST Classification #5

Open pierocavalcanti opened 5 years ago

pierocavalcanti commented 5 years ago

I am trying to replicate the MNIST classification experiment through ECC by following the model configuration reported in your paper. There are some issues that I was not able to solve: 1 - the described network configuration ( C(16)-MP(2,3.4)-C(32)-MP(4,6.8)-C(64)-MP(8,30)-C(128)-D(0.5)-FC(10) ) does not return the proper output dimensions. It seems there is some pooling layer(s) missing. Could you confirm that? Maybe I am missing something in the following description (network configuration in Section 4.4), when a 4x4 to 1 points map is quoted, how should I get points down-sampling with convolutional layer in ECC? 2 - Could you provide further details about data augmentation and other parameters settings for the same MNIST experiment?

mys007 commented 5 years ago

Hi, thanks for your interest and sorry for not providing the code for MNIST experiments. I actually don't have it either, as this repo is a rewrite of part of my original lua-torch codebase.

does not return the proper output dimensions

What do you mean by "not proper" output dimensions? Whatever the pooling is, there should be always at least one point left - and this should be the case after C(128). Can you check the tensor dimensions in your implementation, please?

4x4 to 1 points map is quoted, how should I get points down-sampling with convolutional layer in ECC.

It's conceptually a convolution with 4x4 kernel applied on 4x4 image, which is what one gets with a standard network with padded convolutions and ceil-maxpooling (spatial sizes are 28,14,7,4).

Could you provide further details about data augmentation and other parameters settings for the same MNIST experiment?

I believe there was no data augmentation.

pierocavalcanti commented 5 years ago

Thanks a lot for your prompt answer!!
I try to reformulate my question: the paper indicates "C(16), MP(2,3.4), C(32), MP(4,6.8), C(64), MP(8,30), C(128), D(0.5), FC(10)", but if I use this configuration I get a tensor of dimension: [*16,]. Instead, I would have expected [,], thus I modified the configuration to "C(16), MP(2,3.4), C(32), MP(4,6.8), C(64), MP(8,30), C(128), MP(64,30), D(0.5), FC(10)". Could you double check this modification and confirm that it is necessary to reproduce your network?

Unfortunately I have difficulties to apply your conceptual description. Is it possible to access to an actual implementation of a 4x4 kernel for your convolutional layer? In case, It would be helpful if you could provide the old lua-torch implementation of the network. I will try to find my way through that.

mys007 commented 5 years ago

Perhaps one more question: what is the coordinate domain for image pixels in your implementation, [0,27] x [0,27]?

pierocavalcanti commented 5 years ago

Yes, I generate x and y in the domain [0,27], so I obtain a pointset of 784 points (x,y,0).

mys007 commented 5 years ago

Sorry for the delay! Hmm, I think you're right, the network configuration in paper does not work in the current code base, as strides (=convolutions for graph-to-graph mapping, as it's done for poolings) are not supported:(. So one can resort to alternative but non-equivalent solution, like the modification you've suggested or one can add the global pooling before, as i_1_2.9, c_16,b,r, m_2_3.4, c_32,b,r, m_4_6.8, c_64,b,r, m_1e10_1e10, f_128,b,r,d_0.5,f_10. I guess the performance should be comparable, also to the version described in the paper, I hope you can reach that numbers! Thanks a lot for reporting this problem!

implementation of a 4x4 kernel for your convolutional layer

The kernel is defined by the underlying graph. In case of regular [0,27] x [0,27] and MP(8,30), this results in 4x4 kernel, as there are 4x4 points remaining and all connected. But the problem here is that the graph remains after graph convolutions, conceptual equivalent of conv padding.

LeeHW-THU commented 4 years ago

@pierocavalcanti hello! Did you replicate the MNIST classification ?Can you share your code? thank you!My question is : how input image data in GCN ?or change image data to Graph data?