You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working with a custom GNN model that takes a HeteroData object as input, with two relations. I want to use GNNExplainer to understand the model's predictions. I successfully defined the explainer as follows:
fromtorch_geometric.explainimportExplainer, GNNExplainerfromtorch_geometric.explain.configimportModelConfigexplainer=Explainer(
model=model, # GNN modelalgorithm=GNNExplainer(epochs=200), # Algorithm for explainabilityexplanation_type="model", # Explain the model predictionmodel_config=ModelConfig(
mode="multiclass_classification", # Model modetask_level="node", # Node-level taskreturn_type="raw"# Model returns raw logits
),
edge_mask_type="object"
)
However, when I call it with a HeteroData object like this:
ValueError: Heterogeneous graphs not yet supported in 'GNNExplainer'
Based on the PyTorch Geometric documentation, I expected Explainer to handle both homogeneous and heterogeneous graphs. I read on another discussion that support for HeteroData was foreseen for pyg 2,2.
Is this behavior expected for GNNExplainer, or am I missing something in my setup? If GNNExplainer doesn't support heterogeneous graphs, could you please recommend an alternative explainability method compatible with HeteroData?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi!
I'm working with a custom GNN model that takes a HeteroData object as input, with two relations. I want to use GNNExplainer to understand the model's predictions. I successfully defined the explainer as follows:
However, when I call it with a HeteroData object like this:
I get the following error:
ValueError: Heterogeneous graphs not yet supported in 'GNNExplainer'
Based on the PyTorch Geometric documentation, I expected Explainer to handle both homogeneous and heterogeneous graphs. I read on another discussion that support for HeteroData was foreseen for pyg 2,2.
Is this behavior expected for GNNExplainer, or am I missing something in my setup? If GNNExplainer doesn't support heterogeneous graphs, could you please recommend an alternative explainability method compatible with HeteroData?
Thanks in advance for your kind help!
Luigi
Beta Was this translation helpful? Give feedback.
All reactions