Skip to content

Latest commit

 

History

History
85 lines (58 loc) · 2.81 KB

explain.rst

File metadata and controls

85 lines (58 loc) · 2.81 KB

torch_geometric.explain

torch_geometric.explain

Warning

This module is in active development and may not be stable. Access requires installing PyG from master.

Contents

Philoshopy

This module provides a set of tools to explain the predictions of a PyG model or to explain the underlying phenomenon of a dataset (see the "GraphFramEx: Towards Systematic Evaluation of Explainability Methods for Graph Neural Networks" paper for more details).

We represent explanations using the torch_geometric.explain.Explanation class, which is a ~torch_geometric.data.Data object containing masks for the nodes, edges, features and any attributes of the data.

The torch_geometric.explain.Explainer class is designed to handle all explainability parameters (see the torch_geometric.explain.config.ExplainerConfig class for more details):

  • which algorithm from the torch_geometric.explain.algorithm module to use (e.g., ~torch_geometric.explain.algorithm.GNNExplainer)
  • the type of explanation to compute (e.g., explanation_type="phenomenon" or explanation_type="model")
  • the different type of masks for node and edges (e.g., mask="object" or mask="attributes")
  • any postprocessing of the masks (e.g., threshold_type="topk" or threshold_type="hard")

This class allows the user to easily compare different explainability methods and to easily switch between different types of masks, while making sure the high-level framework stays the same.

Explainer

torch_geometric.explain.Explainer

torch_geometric.explain.config.ExplainerConfig

torch_geometric.explain.config.ModelConfig

torch_geometric.explain.config.ThresholdConfig

Explanations

torch_geometric.explain.Explanation

torch_geometric.explain.HeteroExplanation

Explainer Algorithms

torch_geometric.explain.algorithm

{% for name in torch_geometric.explain.algorithm.classes %}

{{ name }}

{% endfor %}

Explanation Metrics

The quality of an explanation can be judged by a variety of different methods. PyG supports the following metrics out-of-the-box:

torch_geometric.explain.metric

{% for name in torch_geometric.explain.metric.classes %}

{{ name }}

{% endfor %}