From 2728cda6e6c4cc3c8f50768ee1bc640959ed77e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=84=A2=E6=8C=AF=E5=AE=87Michael=20Yan?= <1015198808@qq.com> Date: Mon, 27 Feb 2023 22:34:39 +0800 Subject: [PATCH 1/2] Update subgraphx.rst Add a missing import of Data --- docs/source/tutorials/subgraphx.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/source/tutorials/subgraphx.rst b/docs/source/tutorials/subgraphx.rst index 5f2da0d6..b009d4b8 100644 --- a/docs/source/tutorials/subgraphx.rst +++ b/docs/source/tutorials/subgraphx.rst @@ -82,6 +82,7 @@ Since the graph model is a two-layer GNN model, the information only aggregates from dig.xgraph.method.subgraphx import PlotUtils from dig.xgraph.method.subgraphx import MCTS from torch_geometric.utils import to_networkx + from torch_geometric.data import Data subgraph_x, subgraph_edge_index, subset, edge_mask, kwargs = \ MCTS.__subgraph__(node_idx, data.x, data.edge_index, num_hops=2) From 7ed1646be3a8bdc282c71f840d36d0de7c975db9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=84=A2=E6=8C=AF=E5=AE=87Michael=20Yan?= <1015198808@qq.com> Date: Mon, 27 Feb 2023 23:52:55 +0800 Subject: [PATCH 2/2] Fix wrong arguments. --- docs/source/tutorials/subgraphx.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/source/tutorials/subgraphx.rst b/docs/source/tutorials/subgraphx.rst index b009d4b8..983188ff 100644 --- a/docs/source/tutorials/subgraphx.rst +++ b/docs/source/tutorials/subgraphx.rst @@ -131,8 +131,7 @@ After MCTS searching and Shapley value computation, the subgraph with the highes result = find_closest_node_result(explanation_results[prediction], max_nodes=max_nodes) plotutils = PlotUtils(dataset_name='ba_shapes') - explainer.visualization(explanation_results, - prediction, + explainer.visualization(explanation_results[prediction], max_nodes=max_nodes, plot_utils=plotutils, y=data.y)