class_docstr: The GNN-Explainer model from the `"GNNExplainer: Generating
  Explanations for Graph Neural Networks"
  <https://arxiv.org/abs/1903.03894>`_ paper for identifying compact subgraph
  structures and node features that play a crucial role in the predictions
  made by a GNN.
  
  .. note::
  
      For an example of using :class:`GNNExplainer`, see
      `examples/explain/gnn_explainer.py <https://github.com/pyg-team/
      pytorch_geometric/blob/master/examples/explain/gnn_explainer.py>`_,
      `examples/explain/gnn_explainer_ba_shapes.py <https://github.com/
      pyg-team/pytorch_geometric/blob/master/examples/
      explain/gnn_explainer_ba_shapes.py>`_, and `examples/explain/
      gnn_explainer_link_pred.py <https://github.com/pyg-team/
      pytorch_geometric/blob/master/examples/explain/gnn_explainer_link_pred.py>`_.
  
  .. note::
  
      The :obj:`edge_size` coefficient is multiplied by the number of nodes
      in the explanation at every iteration, and the resulting value is added
      to the loss as a regularization term, with the goal of producing
      compact explanations.
      A higher value will push the algorithm towards explanations with less
      elements.
      Consider adjusting the :obj:`edge_size` coefficient according to the
      average node degree in the dataset, especially if this value is bigger
      than in the datasets used in the original paper.
  
  Args:
      epochs (int, optional): The number of epochs to train.
          (default: :obj:`100`)
      lr (float, optional): The learning rate to apply.
          (default: :obj:`0.01`)
      **kwargs (optional): Additional hyper-parameters to override default
          settings in
          :attr:`~torch_geometric.explain.algorithm.GNNExplainer.coeffs`.
code: def _initialize_masks(self, x: Tensor, edge_index: Tensor):
      node_mask_type = self.explainer_config.node_mask_type
      edge_mask_type = self.explainer_config.edge_mask_type
  
      device = x.device
      (N, F), E = x.size(), edge_index.size(1)
  
      std = 0.1
      if node_mask_type is None:
          self.node_mask = None
      elif node_mask_type == MaskType.object:
          self.node_mask = Parameter(
              torch.randn(N, 1, device=device) * std
          )
      elif node_mask_type == MaskType.attributes:
          self.node_mask = Parameter(
              torch.randn(N, F, device=device) * std
          )
      elif node_mask_type == MaskType.common_attributes:
          self.node_mask = Parameter(
              torch.randn(1, F, device=device) * std
          )
      else:
          assert False
  
      if edge_mask_type is None:
          self.edge_mask = None
      elif edge_mask_type == MaskType.object:
          std = torch.nn.init.calculate_gain("relu") * sqrt(
              2.0 / (2 * N)
          )
          self.edge_mask = Parameter(
              torch.randn(E, device=device) * std
          )
      else:
          assert False
  
imports: from math import sqrt
  from typing import Optional, Tuple, Union
  import torch
  from torch import Tensor
  from torch.nn.parameter import Parameter
  from torch_geometric.explain import ExplainerConfig, Explanation, ModelConfig
  from torch_geometric.explain.algorithm import ExplainerAlgorithm
  from torch_geometric.explain.algorithm.utils import clear_masks, set_masks
  from torch_geometric.explain.config import MaskType, ModelMode, ModelTaskLevel
label_desc: Use image node_id 5 for calling the GNNExplainer obj's underlying member method code with example usage: obj._initialize_masks(x, edge_index) without return types