Replies: 1 comment 2 replies
-
Yeah, we made some interface changes in the new explainer interface. Try the example for PyG 2.2 or update your PyG to latest master. This should resolve it. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello!
I am having some troubles with the GNN Explainer example (examples/gnn_explainer.py): I think that it might be because the example is not up to date but I am not very certain about it.
Indeed if I call the Explainer Class as specified in the example and in the documentation tutorial :
explainer = Explainer( model=model, algorithm=GNNExplainer(epochs=200), explanation_type='model', node_mask_type='attributes', edge_mask_type='object', model_config=dict( mode='multiclass_classification', task_level='node', return_type='log_probs', # Model returns log probabilities. ), )
I get the following error:
__init__() got an unexpected keyword argument 'explanation_type'
which I fixed by checking the source code and thus calling the Explainer class like this:
`explainer = Explainer(
model=model,
algorithm=GNNExplainer(epochs=200),
)`
Now python recognize Explainer to be a torch_geometric.explain.explainer.Explainer type object, but it doesn't have the functions that I would expect it to have according to the tutorial, such as
explanation.visualize_feature_importance(top_k=10)
orexplanation.visualize_graph()
, where explanation was how we instantiate the object Explainer - as indeed I get the error 'GlobalStorage' object has no attribute 'visualize_graph'. By looking at the source code I found out that those functions are defined for the class Explanation , but I am not sure if the class Explainer is inheriting those, or at least it seems to me like this is not the case.
Thank you for your help!
Beta Was this translation helpful? Give feedback.
All reactions