class_docstr: Processes the graph via Graph Diffusion Convolution (GDC) from the
  `"Diffusion Improves Graph Learning" <https://www.kdd.in.tum.de/gdc>`_
  paper (functional name: :obj:`gdc`).
  
  .. note::
  
      The paper offers additional advice on how to choose the
      hyperparameters.
      For an example of using GCN with GDC, see `examples/gcn.py
      <https://github.com/pyg-team/pytorch_geometric/blob/master/examples/
      gcn.py>`_.
  
  Args:
      self_loop_weight (float, optional): Weight of the added self-loop.
          Set to :obj:`None` to add no self-loops. (default: :obj:`1`)
      normalization_in (str, optional): Normalization of the transition
          matrix on the original (input) graph. Possible values:
          :obj:`"sym"`, :obj:`"col"`, and :obj:`"row"`.
          See :func:`GDC.transition_matrix` for details.
          (default: :obj:`"sym"`)
      normalization_out (str, optional): Normalization of the transition
          matrix on the transformed GDC (output) graph. Possible values:
          :obj:`"sym"`, :obj:`"col"`, :obj:`"row"`, and :obj:`None`.
          See :func:`GDC.transition_matrix` for details.
          (default: :obj:`"col"`)
      diffusion_kwargs (dict, optional): Dictionary containing the parameters
          for diffusion.
          `method` specifies the diffusion method (:obj:`"ppr"`,
          :obj:`"heat"` or :obj:`"coeff"`).
          Each diffusion method requires different additional parameters.
          See :func:`GDC.diffusion_matrix_exact` or
          :func:`GDC.diffusion_matrix_approx` for details.
          (default: :obj:`dict(method='ppr', alpha=0.15)`)
      sparsification_kwargs (dict, optional): Dictionary containing the
          parameters for sparsification.
          `method` specifies the sparsification method (:obj:`"threshold"` or
          :obj:`"topk"`).
          Each sparsification method requires different additional
          parameters.
          See :func:`GDC.sparsify_dense` for details.
          (default: :obj:`dict(method='threshold', avg_degree=64)`)
      exact (bool, optional): Whether to exactly calculate the diffusion
          matrix.
          Note that the exact variants are not scalable.
          They densify the adjacency matrix and calculate either its inverse
          or its matrix exponential.
          However, the approximate variants do not support edge weights and
          currently only personalized PageRank and sparsification by
          threshold are implemented as fast, approximate versions.
          (default: :obj:`True`)
  
  :rtype: :class:`torch_geometric.data.Data`
class_docstr_tok: ["Processes","the","graph","via","Graph","Diffusion","Convolution","(","GDC",")","from","the","`","``","Diffusion","Improves","Graph","Learning","''","<","https",":","\/\/www.kdd.in.tum.de\/gdc",">","`","_","paper","(","functional","name",":",":","obj",":","`","gdc","`",")",".","..","note",":",":","The","paper","offers","additional","advice","on","how","to","choose","the","hyperparameters",".","For","an","example","of","using","GCN","with","GDC",",","see","`","examples\/gcn.py","<","https",":","\/\/github.com\/pyg-team\/pytorch_geometric\/blob\/master\/examples\/","gcn.py",">","`","_",".","Args",":","self_loop_weight","(","float",",","optional",")",":","Weight","of","the","added","self-loop",".","Set","to",":","obj",":","`","None","`","to","add","no","self-loops",".","(","default",":",":","obj",":","`","1","`",")","normalization_in","(","str",",","optional",")",":","Normalization","of","the","transition","matrix","on","the","original","(","input",")","graph",".","Possible","values",":",":","obj",":","`","``","sym","''","`",",",":","obj",":","`","``","col","''","`",",","and",":","obj",":","`","``","row","''","`",".","See",":","func",":","`","GDC.transition_matrix","`","for","details",".","(","default",":",":","obj",":","`","``","sym","''","`",")","normalization_out","(","str",",","optional",")",":","Normalization","of","the","transition","matrix","on","the","transformed","GDC","(","output",")","graph",".","Possible","values",":",":","obj",":","`","``","sym","''","`",",",":","obj",":","`","``","col","''","`",",",":","obj",":","`","``","row","''","`",",","and",":","obj",":","`","None","`",".","See",":","func",":","`","GDC.transition_matrix","`","for","details",".","(","default",":",":","obj",":","`","``","col","''","`",")","diffusion_kwargs","(","dict",",","optional",")",":","Dictionary","containing","the","parameters","for","diffusion",".","`","method","`","specifies","the","diffusion","method","(",":","obj",":","`","``","ppr","''","`",",",":","obj",":","`","``","heat","''","`","or",":","obj",":","`","``","coeff","''","`",")",".","Each","diffusion","method","requires","different","additional","parameters",".","See",":","func",":","`","GDC.diffusion_matrix_exact","`","or",":","func",":","`","GDC.diffusion_matrix_approx","`","for","details",".","(","default",":",":","obj",":","`","dict","(","method='ppr","'",",","alpha=0.15",")","`",")","sparsification_kwargs","(","dict",",","optional",")",":","Dictionary","containing","the","parameters","for","sparsification",".","`","method","`","specifies","the","sparsification","method","(",":","obj",":","`","``","threshold","''","`","or",":","obj",":","`","``","topk","''","`",")",".","Each","sparsification","method","requires","different","additional","parameters",".","See",":","func",":","`","GDC.sparsify_dense","`","for","details",".","(","default",":",":","obj",":","`","dict","(","method='threshold","'",",","avg_degree=64",")","`",")","exact","(","bool",",","optional",")",":","Whether","to","exactly","calculate","the","diffusion","matrix",".","Note","that","the","exact","variants","are","not","scalable",".","They","densify","the","adjacency","matrix","and","calculate","either","its","inverse","or","its","matrix","exponential",".","However",",","the","approximate","variants","do","not","support","edge","weights","and","currently","only","personalized","PageRank","and","sparsification","by","threshold","are","implemented","as","fast",",","approximate","versions",".","(","default",":",":","obj",":","`","True","`",")",":","rtype",":",":","class",":","`","torch_geometric.data.Data","`"]
code: def __init__(
      self,
      self_loop_weight: float = 1.0,
      normalization_in: str = "sym",
      normalization_out: str = "col",
      diffusion_kwargs: Dict[str, Any] = dict(method="ppr", alpha=0.15),
      sparsification_kwargs: Dict[str, Any] = dict(
          method="threshold",
          avg_degree=64,
      ),
      exact: bool = True,
  ) -> None:
      self.self_loop_weight = self_loop_weight
      self.normalization_in = normalization_in
      self.normalization_out = normalization_out
      self.diffusion_kwargs = diffusion_kwargs
      self.sparsification_kwargs = sparsification_kwargs
      self.exact = exact
  
      if self_loop_weight:
          assert exact or self_loop_weight == 1
  
imports: from typing import Any, Dict, Tuple
  import numpy
  import torch
  from scipy.linalg import expm
  from torch import Tensor
  from torch_geometric.data import Data
  from torch_geometric.data.datapipes import functional_transform
  from torch_geometric.transforms import BaseTransform
  from torch_geometric.utils import add_self_loops, coalesce, get_ppr, is_undirected, scatter, sort_edge_index, to_dense_adj
label_desc: Use image node_id 1 to create a new GDC object from inherited base classes: BaseTransform with example: obj = GDC(_loop_weight, normalization_in, normalization_out, diffusion_kwargs, sparsification_kwargs, exact)