Replies: 4 comments 6 replies
-
Could you share the result of |
Beta Was this translation helpful? Give feedback.
-
Thanks
I have hetero edges with hetero label
And each category of edge have different y size.
In the out I have tensor with size 162, 162, 55,55 but in the batch.y I
have size 162, 55, 162, 55
|
Beta Was this translation helpful? Give feedback.
-
It means I have different size of label for each subgraph or edge type
I have an edge classification Task. i have different node type, different edge type and for each edge, 22 features and label i have.
for example,
```
data = HeteroData()
data['n1'].x = torch.tensor(df['f1']).reshape([-1, 1])
data['n1'].x = data['n1'].x.type(torch.FloatTensor)
data['n2'].x = torch.tensor(df['f2']).reshape([-1, 1])
data['n2'].x = data['n2'].x.type(torch.FloatTensor)
data['n1','type1', 'n2'].edge_index = e1
data['n1','type1', 'n2'].edge_attr = node_features
data['n3'].x = torch.tensor(df['f3']).reshape([-1, 1])
data['n3'].x = data['n3'].x.float()
data['n4'].x = torch.tensor(df['f3']).reshape([-1, 1])
data['n4'].x = data['n4'].x.float()
data['n3','type2', 'n4'].edge_index = e3
data['n3','type2', 'n4'].edge_attr = node_features
data['n1','type1', 'n2'].y = y1
data['n3','type2', 'n4'].y = y3
```
my label vector size is different per edge type
|
Beta Was this translation helpful? Give feedback.
-
`
model = GNN(hidden_channels=64, out_channels=1)
error: i guess my model is for node classification but my goal is edge classification, for this aim, the |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
my code is>
model.train()
for batch in train_loader:
out = model(batch.x_dict, batch.edge_index_dict, batch)
error is>
AttributeError: 'HeteroDataBatch' has no attribute 'y'
and when used batch.y_dict, the error is >
TypeError: cross_entropy_loss(): argument 'target' (position 2) must be Tensor, not dict
Can you make suggestions for this error?
Beta Was this translation helpful? Give feedback.
All reactions