Hello,
I’m quite new to DGL, I’ve played with the “karate club” tutorial : https://docs.dgl.ai/tutorials/basics/1_first.html
I’ve understood that this code snippet can compute all inferences at the same time.
net(G,G.ndata['h'])
and I got coherent results like this :
tensor([[ 1.7417, -2.1720],
[ 1.0800, -1.4717],
[ 0.0979, -0.3240],
[ 1.7078, -2.1691],
[ 2.1232, -2.5470],
[ 2.1904, -2.5734],
....
But when I try to only run inference for one feature (the first one) :
g = G.subgraph(0)
x = G.ndata['h'][0].reshape(1,5)
net(g,x)
I got a different result …
tensor([[ 3.3179, -3.9537]], grad_fn=<AddmmBackward>)
I was expecting : [ 1.7417, -2.1720] which is the first line of the inference on all features/nodes
What is the difference ? What did I miss ?
Any help will be appreciated.
regards, H.