class_docstr: An implementation of FlowX in
  `FlowX: Towards Explainable Graph Neural Networks via Message Flows <https://arxiv.org/abs/2206.12987>`_.
  Args:
      model (torch.nn.Module): The target model prepared to explain.
      epochs (int, optional): The training steps.
      lr (float, optional): The explainer training learning rate.
      explain_graph (bool, optional): Whether to explain graph classification model.
          (default: :obj:`False`)
  .. note::
          For node classification model, the :attr:`explain_graph` flag is False.
class_docstr_tok: ["An","implementation","of","FlowX","in","`","FlowX",":","Towards","Explainable","Graph","Neural","Networks","via","Message","Flows","<","https",":","\/\/arxiv.org\/abs\/2206.12987",">","`","_",".","Args",":","model","(","torch.nn.Module",")",":","The","target","model","prepared","to","explain",".","epochs","(","int",",","optional",")",":","The","training","steps",".","lr","(","float",",","optional",")",":","The","explainer","training","learning","rate",".","explain_graph","(","bool",",","optional",")",":","Whether","to","explain","graph","classification","model",".","(","default",":",":","obj",":","`","False","`",")","..","note",":",":","For","node","classification","model",",","the",":","attr",":","`","explain_graph","`","flag","is","False","."]
code: def __init__(
      self,
      model,
      epochs=500,
      lr=3e-1,
      explain_graph=False,
      molecule=False,
  ):
      # def __init__(self, model, epochs=500, lr=1e-1, explain_graph=False, molecule=False):
      super().__init__(
          model=model,
          epochs=epochs,
          lr=lr,
          explain_graph=explain_graph,
          molecule=molecule,
      )
  
      self.score_structure = [
          (i % 2, term_idx)
          for i in range(1, self.num_layers + 1)
          for term_idx in combinations(range(self.num_layers), i)
      ]
  
      self.ns_iter = 30
      self.ns_per_iter = None
      self.fidelity_plus = True
      self.score_lr = 0e-5  # 2e-5
      # self.alpha = 0.5
  
      self.no_mask = False
      if self.no_mask:
          self.epochs = 1
          self.lr = 0
          self.score_lr = 0
  
file_path: DIG/dig/xgraph/method/flowx.py
imports: from itertools import combinations
  from typing import List, Tuple, Union, Dict
  import torch
  import torch.nn
  from torch import Tensor
  from torch.nn.functional import cross_entropy
  from torch_geometric.utils.loop import add_self_loops, remove_self_loops
  from .base_explainer import WalkBase
  from ..models.utils import subgraph, gumbel_softmax
label_desc: Use image node_id 1 to create a new FlowX object from inherited base classes: WalkBase with example: obj = FlowX(model, epochs, lr, explain_graph, molecule)