Replies: 2 comments
-
You should modify your def forward(self, x, edge_index, edge_weight, batch): |
Beta Was this translation helpful? Give feedback.
0 replies
-
do you solve it? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I don't know how to use GNNexplainer for graph classification.
I applied a GCN for graph binary classification, and I want to use GNNexplainer to explain the prediction. But I don't know how to apply GNNexplainer on my model.
Here is my GCN model code:
Here is the GNNexplainer code:
Then the error is like this :
"---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[27], line 31
18 # Initialize the GNNExplainer with your model and algorithm settings
19 explainer = Explainer(
20 model=model,
21 algorithm=GNNExplainer(epochs=200),
(...)
29 ),
30 )
---> 31 explanation = explainer(data.x, data.edge_index, data.batch)
33 # explanation = explainer(
34 # x=data.x,
35 # edge_index=data.edge_index,
(...)
40 # You can use the explanation for visualization or analysis
41 # Access the importance scores using explanation.node_importance and explanation.edge_mask
42 print("Node Importance Scores:", explanation.node_importance)
TypeError: Explainer.call() takes 3 positional arguments but 4 were given"
Can anyone help me apply GNNExplainer on my model?
Beta Was this translation helpful? Give feedback.
All reactions