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:
      dataset (torch_geometric.data.Dataset): The graph classification dataset.
      classifier (string, optional): Linear classifier for evaluation, :obj:`"SVC"` or 
          :obj:`"LogReg"`. (default: :obj:`"SVC"`)
      log_interval (int, optional): Perform evaluation per k epochs. (default: :obj:`1`)
      epoch_select (string, optional): :obj:`"test_max"` or :obj:`"val_max"`.
          (default: :obj:`"test_max"`)
      n_folds (int, optional): Number of folds for evaluation. (default: :obj:`10`)
      device (int, or torch.device, optional): Device for computation. (default: :obj:`None`)
      **kwargs (optional): Training and evaluation configs in :meth:`setup_train_config`.
      
  Examples
  --------
  >>> encoder = Encoder(...)
  >>> model = Contrastive(...)
  >>> evaluator = GraphUnsupervised(dataset, log_interval=10, device=0, p_lr = 0.001)
  >>> evaluator.evaluate(model, encoder)
class_docstr_tok: ["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",":","dataset","(","torch_geometric.data.Dataset",")",":","The","graph","classification","dataset",".","classifier","(","string",",","optional",")",":","Linear","classifier","for","evaluation",",",":","obj",":","`","``","SVC","''","`","or",":","obj",":","`","``","LogReg","''","`",".","(","default",":",":","obj",":","`","``","SVC","''","`",")","log_interval","(","int",",","optional",")",":","Perform","evaluation","per","k","epochs",".","(","default",":",":","obj",":","`","1","`",")","epoch_select","(","string",",","optional",")",":",":","obj",":","`","``","test_max","''","`","or",":","obj",":","`","``","val_max","''","`",".","(","default",":",":","obj",":","`","``","test_max","''","`",")","n_folds","(","int",",","optional",")",":","Number","of","folds","for","evaluation",".","(","default",":",":","obj",":","`","10","`",")","device","(","int",",","or","torch.device",",","optional",")",":","Device","for","computation",".","(","default",":",":","obj",":","`","None","`",")","*","*","kwargs","(","optional",")",":","Training","and","evaluation","configs","in",":","meth",":","`","setup_train_config","`",".","Examples","--","--","--","--",">",">",">","encoder","=","Encoder","(","...",")",">",">",">","model","=","Contrastive","(","...",")",">",">",">","evaluator","=","GraphUnsupervised","(","dataset",",","log_interval=10",",","device=0",",","p_lr","=","0.001",")",">",">",">","evaluator.evaluate","(","model",",","encoder",")"]
docstr: Method to setup training config.
  
  Args:
      batch_size (int, optional): Batch size for pretraining and inference. 
          (default: :obj:`256`)
      p_optim (string, or torch.optim.Optimizer class): Optimizer for pretraining.
          (default: :obj:`"Adam"`)
      p_lr (float, optional): Pretraining learning rate. (default: :obj:`0.01`)
      p_weight_decay (float, optional): Pretraining weight decay rate. 
          (default: :obj:`0`)
      p_epoch (int, optional): Pretraining epochs number. (default: :obj:`20`)
      svc_search (string, optional): If :obj:`True`, search for hyper-parameter 
          :obj:`C` in SVC. (default: :obj:`True`)
code: def setup_train_config(
      self,
      batch_size=256,
      p_optim="Adam",
      p_lr=0.01,
      p_weight_decay=0,
      p_epoch=20,
      svc_search=True,
  ):
      r"""Method to setup training config.
  
      Args:
          batch_size (int, optional): Batch size for pretraining and inference.
              (default: :obj:`256`)
          p_optim (string, or torch.optim.Optimizer class): Optimizer for pretraining.
              (default: :obj:`"Adam"`)
          p_lr (float, optional): Pretraining learning rate. (default: :obj:`0.01`)
          p_weight_decay (float, optional): Pretraining weight decay rate.
              (default: :obj:`0`)
          p_epoch (int, optional): Pretraining epochs number. (default: :obj:`20`)
          svc_search (string, optional): If :obj:`True`, search for hyper-parameter
              :obj:`C` in SVC. (default: :obj:`True`)
      """
  
      self.batch_size = batch_size
  
      self.p_optim = p_optim
      self.p_lr = p_lr
      self.p_weight_decay = p_weight_decay
      self.p_epoch = p_epoch
  
      self.search = svc_search
  
imports: import copy
  import torch
  import numpy
  import torch.nn
  from tqdm import trange
  from sklearn.model_selection import StratifiedKFold
  from torch_geometric.loader import DataLoader
  from sklearn.svm import SVC
  from sklearn import preprocessing
  from sklearn.metrics import accuracy_score
  from sklearn.model_selection import GridSearchCV
label_desc: Use image node_id 2 for calling the GraphUnsupervised obj's underlying member method code with example usage: obj.setup_train_config(batch_size, p_optim, p_lr, p_weight_decay, p_epoch, svc_search) without return types