class_docstr: The evaluation interface for unsupervised graph representation learning evaluated with 
  linear classification. You can refer to `the benchmark code 
  <https://github.com/divelab/DIG/tree/dig/benchmarks/sslgraph>`_ 
  for examples of usage.
  
  Args:
      full_dataset (torch_geometric.data.Dataset): The graph classification dataset.
      train_mask (Tensor, optional): Boolean tensor of shape :obj:`[n_nodes,]`, indicating 
          nodes for training. Set to :obj:`None` if included in dataset.
          (default: :obj:`None`)
      val_mask (Tensor, optional): Boolean tensor of shape :obj:`[n_nodes,]`, indicating 
          nodes for validation. Set to :obj:`None` if included in dataset.
          (default: :obj:`None`)
      test_mask (Tensor, optional): Boolean tensor of shape :obj:`[n_nodes,]`, indicating 
          nodes for test. Set to :obj:`None` if included in dataset. (default: :obj:`None`)
      classifier (string, optional): Linear classifier for evaluation, :obj:`"SVC"` or 
          :obj:`"LogReg"`. (default: :obj:`"LogReg"`)
      log_interval (int, optional): Perform evaluation per k epochs. (default: :obj:`1`)
      device (int, or torch.device, optional): Device for computation. (default: :obj:`None`)
      **kwargs (optional): Training and evaluation configs in :meth:`setup_train_config`.
      
  Examples
  --------
  >>> node_dataset = get_node_dataset("Cora") # using default train/test split
  >>> evaluator = NodeUnsupervised(node_dataset, log_interval=10, device=0)
  >>> evaluator.evaluate(model, encoder)
  
  >>> node_dataset = SomeDataset()
  >>> # Using your own dataset or with different train/test split
  >>> train_mask, val_mask, test_mask = torch.Tensor([...]), torch.Tensor([...]), torch.Tensor([...])
  >>> evaluator = NodeUnsupervised(node_dataset, train_mask, val_mask, test_mask, log_interval=10, device=0)
  >>> evaluator.evaluate(model, encoder)
docstr: Perform grid search on learning rate and epochs in pretraining.
  
  Args:
      learning_model: An object of a contrastive model (sslgraph.method.Contrastive) 
          or a predictive model.
      encoder (torch.nn.Module): Trainable pytorch model or list of models.
      p_lr_lst (list, optional): List of learning rate candidates.
      p_epoch_lst (list, optional): List of epochs number candidates.
  
  :rtype: (float, float, (float, int))
docstr_tok: ["Perform","grid","search","on","learning","rate","and","epochs","in","pretraining",".","Args",":","learning_model",":","An","object","of","a","contrastive","model","(","sslgraph.method.Contrastive",")","or","a","predictive","model",".","encoder","(","torch.nn.Module",")",":","Trainable","pytorch","model","or","list","of","models",".","p_lr_lst","(","list",",","optional",")",":","List","of","learning","rate","candidates",".","p_epoch_lst","(","list",",","optional",")",":","List","of","epochs","number","candidates",".",":","rtype",":","(","float",",","float",",","(","float",",","int",")",")"]
code: def grid_search(
      self,
      learning_model,
      encoder,
      p_lr_lst=[0.1, 0.01, 0.001],
      p_epoch_lst=[2000],
  ):
      r"""Perform grid search on learning rate and epochs in pretraining.
  
      Args:
          learning_model: An object of a contrastive model (sslgraph.method.Contrastive)
              or a predictive model.
          encoder (torch.nn.Module): Trainable pytorch model or list of models.
          p_lr_lst (list, optional): List of learning rate candidates.
          p_epoch_lst (list, optional): List of epochs number candidates.
  
      :rtype: (float, float, (float, int))
      """
  
      acc_m_lst = []
      acc_sd_lst = []
      paras = []
      for p_lr in p_lr_lst:
          for p_epoch in p_epoch_lst:
              self.setup_train_config(p_lr=p_lr, p_epoch=p_epoch)
              model = copy.deepcopy(learning_model)
              enc = copy.deepcopy(encoder)
              acc_m, acc_sd = self.evaluate(model, enc)
              acc_m_lst.append(acc_m)
              acc_sd_lst.append(acc_sd)
              paras.append((p_lr, p_epoch))
      idx = np.argmax(acc_m_lst)
      print(
          "Best paras: %d epoch, lr=%f, acc=%.4f"
          % (paras[idx][1], paras[idx][0], acc_m_lst[idx])
      )
  
      return acc_m_lst[idx], acc_sd_lst[idx], paras[idx]
  
imports: import copy
  import torch
  import numpy
  import torch.nn
  from torch_geometric.loader import DataLoader
  from sklearn import preprocessing
label_desc: Use image node_id 5 for calling the NodeUnsupervised obj's underlying member method code with example usage: obj.grid_search(learning_model, encoder, p_lr_lst, p_epoch_lst) and returns: acc_m_lst,  acc_sd_lst,  paras