class_docstr: The layer-dependent importance sampler from the
  `"Layer-Dependent Importance Sampling for Training Deep and Large Graph Convolutional Networks"
  <https://arxiv.org/abs/1911.07323>`_ literature,  which allows
  for mini-batch training of GNNs on large-scale graphs where full-batch training is not feasible.
  
  Arguments
  ------------
  edge_index:
      A :obj:`torch.LongTensor` that defines the underlying graph
      connectivity/message passing flow.
      :obj:`edge_index` holds the indices of a (sparse) adjacency matrix.
      If :obj:`edge_index` is of type :obj:`torch.LongTensor`, its shape
      must be defined as :obj:`[2, num_edges]`, where messages from nodes
      :obj:`edge_index[0]` are sent to nodes in :obj:`edge_index[1]`
      (in case :obj:`flow="source_to_target"`).
  target_nodes_indexes:
      indexes of target nodes to learn representation.
  layer_wise_arguments:
      The number of nodes to sample for each layer.
      It's noteworthy that the target nodes for a specific layer
      always be preserved as source nodes for that layer,
      such that the self loops for those target nodes
      are generally preserved for representation learning.
  batch_size:
      number of target nodes for each mini-batch.
  num_workers:
      num_workers argument for inner :class:`torch.utils.data.DataLoader`
  shuffle:
      whether to shuffle target nodes for mini-batches.
class_docstr_tok: ["The","layer-dependent","importance","sampler","from","the","`","``","Layer-Dependent","Importance","Sampling","for","Training","Deep","and","Large","Graph","Convolutional","Networks","''","<","https",":","\/\/arxiv.org\/abs\/1911.07323",">","`","_","literature",",","which","allows","for","mini-batch","training","of","GNNs","on","large-scale","graphs","where","full-batch","training","is","not","feasible",".","Arguments","--","--","--","--","--","--","edge_index",":","A",":","obj",":","`","torch.LongTensor","`","that","defines","the","underlying","graph","connectivity\/message","passing","flow",".",":","obj",":","`","edge_index","`","holds","the","indices","of","a","(","sparse",")","adjacency","matrix",".","If",":","obj",":","`","edge_index","`","is","of","type",":","obj",":","`","torch.LongTensor","`",",","its","shape","must","be","defined","as",":","obj",":","`","[","2",",","num_edges","]","`",",","where","messages","from","nodes",":","obj",":","`","edge_index","[","0","]","`","are","sent","to","nodes","in",":","obj",":","`","edge_index","[","1","]","`","(","in","case",":","obj",":","`","flow=","''","source_to_target","''","`",")",".","target_nodes_indexes",":","indexes","of","target","nodes","to","learn","representation",".","layer_wise_arguments",":","The","number","of","nodes","to","sample","for","each","layer",".","It","'s","noteworthy","that","the","target","nodes","for","a","specific","layer","always","be","preserved","as","source","nodes","for","that","layer",",","such","that","the","self","loops","for","those","target","nodes","are","generally","preserved","for","representation","learning",".","batch_size",":","number","of","target","nodes","for","each","mini-batch",".","num_workers",":","num_workers","argument","for","inner",":","class",":","`","torch.utils.data.DataLoader","`","shuffle",":","whether","to","shuffle","target","nodes","for","mini-batches","."]
code: def __init__(
      self,
      edge_index: torch.LongTensor,
      target_nodes_indexes: torch.LongTensor,
      layer_wise_arguments: _typing.Sequence,
      batch_size: _typing.Optional[int] = 1,
      num_workers: int = 0,
      shuffle: bool = True,
      **kwargs,
  ):
      super(LayerDependentImportanceSampler, self).__init__(
          torch_geometric.utils.add_remaining_self_loops(edge_index)[0],
          target_nodes_indexes,
          layer_wise_arguments,
          batch_size,
          num_workers,
          shuffle,
          **kwargs,
      )
      self.__edge_weight: torch.Tensor = self.__compute_edge_weight(
          self._edge_index
      )
      self.__integral_normalized_l_matrix: sp.csr_matrix = (
          sp.csr_matrix(
              (
                  self.__edge_weight.numpy(),
                  (
                      self._edge_index[1].numpy(),
                      self._edge_index[0].numpy(),
                  ),
              )
          )
      )
      self.__integral_edges_indexes_sparse_matrix: sp.csr_matrix = (
          sp.csr_matrix(
              (
                  np.arange(self._edge_index.size(1)),
                  (
                      self._edge_index[1].numpy(),
                      self._edge_index[0].numpy(),
                  ),
              )
          )
      )
  
file_path: AutoGL/autogl/module/train/sampling/sampler/layer_dependent_importance_sampler.py
imports: import numpy
  import scipy.sparse
  import torch
  import torch.utils.data
  import typing
  import torch_geometric
  from .None import target_dependant_sampler
label_desc: Use image node_id 2 to create a new LayerDependentImportanceSampler object from inherited base classes: target_dependant_sampler with example: obj = LayerDependentImportanceSampler(edge_index, target_nodes_indexes, layer_wise_arguments, batch_size, num_workers, shuffle)