Open WatsonLee opened 1 year ago
Mh, this would be weird - this certainly has to do something with weight initialization IMO. Given the same weights for embedding and GCNConv
, the output should be the same. Can you test that?
Also: Did you fix the seed? What happens if you move the self.init_weights()
call up directly after the GCNConv
definitions (ensuring that Embedding
layers are initialized the same)?
Thank you for your suggestion. Yes, to ensure the reproducibility of our code, we fixed the seeds of random, torch, numpy and other modules at the beginning.
We try to move the self.init_weights() directly after the GCNConv definitions, the experimental result is different from those of Original and Modified.
We don't know how to implement your intent, `` Given the same weights for embedding and GCNConv'', can you give us some hints?
Thank you.
A simple test would be
torch.save(conv1, 'conv1.pt')
torch.save(conv2, 'conv2.pt')
in your single model, and then load them in your other model
self.conv1 = torch.load('conv1.pt')
self.conv2 = torch.load('conv2.pt')
You can confirm that this shares the same weights by running
print(self.conv1.lin.weight)
on both models.
Hello, we have tried your suggestion and their weights are not the same. Moreover, when we increase the training epoch, they can indeed get similar results, although the convergence speed will be different.
Thanks for your suggestion.
🐛 Describe the bug
Hello, we have encountered a problem when using GCNConv and HypergraphConv for graph representation learning. We want to use GCNConv and HypergraphConv layers to process graph1 and graph2, respectively. However, when we add the HypergraphConv layer, even if nothing is done, the original GCNConv-based model training results will be greatly affected.
Original
Modified
We guess it is not an problem caused by parameter initialization? We don't know how to fix it. Looking forward to your reply.
Environment
conda
,pip
, source): Condatorch-scatter
):