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","."]
docstr: :param __current_layer_target_nodes_indexes: indexes of target nodes for current layer
  :param __top_layer_target_nodes_indexes: indexes of target nodes for top layer
  :param sampled_source_nodes_budget: sampled source nodes budget
  :return: (
              sampled_edges_indexes,
              sampled_source_nodes_indexes,
              corresponding probabilities for sampled_source_nodes_indexes
  )
docstr_tok: [":","param","__current_layer_target_nodes_indexes",":","indexes","of","target","nodes","for","current","layer",":","param","__top_layer_target_nodes_indexes",":","indexes","of","target","nodes","for","top","layer",":","param","sampled_source_nodes_budget",":","sampled","source","nodes","budget",":","return",":","(","sampled_edges_indexes",",","sampled_source_nodes_indexes",",","corresponding","probabilities","for","sampled_source_nodes_indexes",")"]
code: def __sample_edges(
      self,
      __current_layer_target_nodes_indexes: np.ndarray,
      __top_layer_target_nodes_indexes: np.ndarray,
      sampled_source_nodes_budget: int,
  ) -> _typing.Tuple[np.ndarray, np.ndarray, np.ndarray]:
      """
  
      :param __current_layer_target_nodes_indexes: indexes of target nodes for current layer
      :param __top_layer_target_nodes_indexes: indexes of target nodes for top layer
      :param sampled_source_nodes_budget: sampled source nodes budget
      :return: (
                  sampled_edges_indexes,
                  sampled_source_nodes_indexes,
                  corresponding probabilities for sampled_source_nodes_indexes
      )
      """
      partial_l_matrix: sp.csr_matrix = (
          self.__integral_normalized_l_matrix[
              __current_layer_target_nodes_indexes, :
          ]
      )
      p: np.ndarray = np.array(
          np.sum(partial_l_matrix.multiply(partial_l_matrix), axis=0)
      )[0]
      p: np.ndarray = p / np.sum(p)
      _number_of_nodes_to_sample = np.min(
          [np.sum(p > 0), sampled_source_nodes_budget]
      )
      _selected_source_nodes: np.ndarray = np.unique(
          np.concatenate(
              [
                  np.random.choice(
                      p.size,
                      _number_of_nodes_to_sample,
                      replace=False,
                      p=p,
                  ),
                  __top_layer_target_nodes_indexes,
              ]
          )
      )
  
      _sampled_edges_indexes_sparse_matrix: sp.csr_matrix = (
          self.__integral_edges_indexes_sparse_matrix[
              __current_layer_target_nodes_indexes, :
          ]
      )
      _sampled_edges_indexes_sparse_matrix: sp.csc_matrix = (
          _sampled_edges_indexes_sparse_matrix.tocsc()[
              :, _selected_source_nodes
          ]
      )
      _sampled_edges_indexes: np.ndarray = np.unique(
          _sampled_edges_indexes_sparse_matrix.data
      )
  
      return (
          _sampled_edges_indexes,
          _selected_source_nodes,
          p[_selected_source_nodes],
      )
  
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 3 for calling the LayerDependentImportanceSampler obj's underlying member method code with example usage: obj.__sample_edges(__current_layer_target_nodes_indexes, __top_layer_target_nodes_indexes, sampled_source_nodes_budget) and returns: _sampled_edges_indexes,  _selected_source_nodes,  p