Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the methods in xgraph can only explain model in dig.xgraph.models #184

Open
Oliver-0423 opened this issue Feb 3, 2023 · 4 comments
Open
Labels
xgraph Interpretability of Graph Neural Networks

Comments

@Oliver-0423
Copy link

Oliver-0423 commented Feb 3, 2023

the methods in xgraph can only explain model in dig.xgraph.models,i try to use it to explain my model which is built by PYG, get the error:

KeyError: 'explain_message'

this is my model:

from torch_geometric.nn import GCNConv
class Net(torch.nn.Module):
    def __init__(self):
        super().__init__()
        self.conv1 = GCNConv(dataset.num_features, 16, normalize=False)
        self.conv2 = GCNConv(16, dataset.num_classes, normalize=False)
    def forward(self, x, edge_index):
        x = F.relu(self.conv1(x, edge_index))
        x = F.dropout(x, training=self.training)
        x = self.conv2(x, edge_index)
        return F.log_softmax(x, dim=1)
@Oliver-0423
Copy link
Author

Oliver-0423 commented Feb 3, 2023

pyg version 2.1.0,
dig version 1.0.0
torch 1.13.0

@mengliu1998 mengliu1998 added the xgraph Interpretability of Graph Neural Networks label Feb 14, 2023
@Oceanusity
Copy link
Collaborator

Please refer to the model defined in https://github.com/divelab/DIG/blob/dig-stable/dig/xgraph/models/models.py

@chriswu99aaa
Copy link

@Oceanusity So we can only explain models defined in the models.py file? Can we explain models that are built as the combinations from models from the file? For example, if I define a model which combines GCN_3l and GCN_2l, we the explaining methods work as well?

@Oceanusity
Copy link
Collaborator

I think so, if the new GNN is the subclass of GNNBasic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
xgraph Interpretability of Graph Neural Networks
Projects
None yet
Development

No branches or pull requests

4 participants