Replies: 4 comments 8 replies
-
You should be able to apply normalization on your own via for node_type in data.node_types:
x = data[node_type].x
x = (x - x.mean(dim=0, keepdim=True)) / x.std(dim=0, keepdim=True)
data[node_type].x = x If the loss is very high, that usually means that there is some bug somewhere. Are you using cross entropy loss? |
Beta Was this translation helpful? Give feedback.
-
Thanks so much for clarifying normalization! Also please find below the code to train the GNN:
I followed the code given in https://github.com/pyg-team/pytorch_geometric/blob/master/examples/hetero/to_hetero_mag.py. Thanks! |
Beta Was this translation helpful? Give feedback.
-
Hi, Sorry one more doubt. Actually my graph is a bipartite graph (2 node types) and its a big graph with 10M nodes of each type and 1B edges. Therefore, I need to do Neighbor sampling to be able to fit and train GNN on my GPU. I followed the approach given in https://github.com/pyg-team/pytorch_geometric/blob/master/examples/hetero/to_hetero_mag.py (just treated my undirected bipartite graph as hetero graph). I request you to please guide me if there is something wrong with this approach. Thank you! |
Beta Was this translation helpful? Give feedback.
-
Hi, Sorry for pulling this thread again. I wanted your guidance regarding one more query. I want to do inductive learning on the Hetero graph (train and test on different snapshots). I am using the same approach as in this link https://github.com/pyg-team/pytorch_geometric/blob/master/examples/hetero/to_hetero_mag.py. They are training SAGE model which works in inductive setting as well. Please guide me this is correct? Thanks so much! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I am working on Heterogeneous Node Classification task. The HeteroData looks as below:
HeteroData(
c={
x=[55590, 47],
y=[55590],
train_mask=[55590],
val_mask=[55590],
test_mask=[55590]
},
m={ x=[40754, 2] },
(c, uses, m)={ edge_index=[2, 625074] }
)
I want to normalize the each dimension of the feature vector (The features of node types 'c' and 'm' are different).
I came across NormalizeFeatures function which Row-normalizes the attributes. Could you please help me if there is any function which can do the column-wise scaling, since the node features are of varying scale and I am not sure if NormalizeFeatures makes sense in this case.
Also, my second doubt is regarding the performance of GNN.
During training the model, the loss is very high initially:
Epoch: 001, Loss: 4277.0679, Train: 0.9471, Test: 0.9423
Epoch: 002, Loss: 10906.3450, Train: 0.9610, Test: 0.9476
And there is not much improvement in the accuracy as well. That is, for over 100 epochs the accuracy on test set still remains between 94 - 95%.
Could you please guide me regarding these queries. Thanks so much for your help!
Beta Was this translation helpful? Give feedback.
All reactions