class_docstr: Graph Convolutional Network
class_docstr_tok: ["Graph","Convolutional","Network"]
code: def edge_sampling(self, edge_index, edge_type, rate=0.5):
      # edge_index: [2, -1]
      # edge_type: [-1]
      n_edges = edge_index.shape[1]
      random_indices = np.random.choice(
          n_edges, size=int(n_edges * rate), replace=False
      )
      return edge_index[:, random_indices], edge_type[random_indices]
  
imports: import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  import scipy.sparse
  from recbole.model.abstract_recommender import KnowledgeRecommender
  from recbole.model.init import xavier_uniform_initialization
  from recbole.model.layers import SparseDropout
  from recbole.model.loss import BPRLoss, EmbLoss
  from recbole.utils import InputType
label_desc: Use image node_id 2 for calling the GraphConv obj's underlying member method code with example usage: obj.edge_sampling(edge_index, edge_type, rate) and returns: edge_index,  edge_type