Hi @lrjconan,
Thank you for sharing this awesome code!
LanczosNet works very well on QM8, and I am working on reproducing your results on Cora dataset.
With the hyperparameters given in the appendix of the paper, I can get 80.3 accuracy with one seed (slightly higher than the reported mean in the paper). However, it seems that LanczosNet has a very high variance and often underfits (both training and test accuracy are low).
There should be some parts in the paper that I misunderstood.
Would it be possible for you to read my code and help me figure them out?
Here is the code (lanczos_net_cora.py) of LanczosNet for Cora that I modified from the QM8 model.
LanczosNet, we set the short and long diffusion scales to {1, 2, 5, 7} and {10, 20, 30} respectively.
The hidden dimension is 64 and dropout is 0.5. Lanczos step is 20. 1-layer MLP with 128 hidden
units and ReLU nonlinearity is used as the spectral filter.
Following this line, I use nfeat=1433, nhid=64, nclass=7, dropout=0.5, num_layer=2, num_eig_vec=20, spectral_filter_kind='MLP', short_diffusion_dist=[1, 2, 5, 7], long_diffusion_dist=[10, 20, 30]
.
The nfeat and nclass are determined by the Cora dataset.
When I printed the model, I got
LanczosNet(
(filter): ModuleList(
(0): Linear(in_features=11464, out_features=64, bias=True)
(1): Linear(in_features=512, out_features=7, bias=True)
)
(spectral_filter): ModuleList(
(0): Sequential(
(0): Linear(in_features=3, out_features=128, bias=True)
(1): ReLU()
(2): Linear(in_features=128, out_features=3, bias=True)
)
(1): Sequential(
(0): Linear(in_features=3, out_features=128, bias=True)
(1): ReLU()
(2): Linear(in_features=128, out_features=3, bias=True)
)
)
)
The L, D, V are pre-computed using the get_graph_laplacian_eigs
function in your
data_helper.py script.
I use the training code from https://github.com/tkipf/pygcn.
Since there is only a single graph, the input has no batch dimension. I unsqueeze the inputs and squeeze the outputs.
Thanks,
Felix