class_docstr: The graph classification trainer.
  
  Used to automatically train the graph classification problem.
  
  Parameters
  ----------
  model:
      Models can be ``str``, ``autogl.module.model.BaseAutoModel``, 
      ``autogl.module.model.encoders.BaseEncoderMaintainer`` or a tuple of (encoder, decoder) 
      if need to specify both encoder and decoder. Encoder can be ``str`` or
      ``autogl.module.model.encoders.BaseEncoderMaintainer``, and decoder can be ``str``
      or ``autogl.module.model.decoders.BaseDecoderMaintainer``.
      If only encoder is specified, decoder will be default to "logsoftmax"
  
  num_features: int (Optional)
      The number of features in dataset. default None
  
  num_classes: int (Optional)
      The number of classes. default None
  
  num_graph_features: int (Optional)
      The number of graph level features. default 0.
  
  optimizer: ``Optimizer`` of ``str``
      The (name of) optimizer used to train and predict. default torch.optim.Adam
  
  lr: ``float``
      The learning rate of node classification task. default 1e-4
  
  max_epoch: ``int``
      The max number of epochs in training. default 100
  
  early_stopping_round: ``int``
      The round of early stop. default 100
  
  weight_decay: ``float``
      weight decay ratio, default 1e-4
  
  device: ``torch.device`` or ``str``
      The device where model will be running on.
  
  init: ``bool``
      If True(False), the model will (not) be initialized.
  
  feval: (Sequence of) ``Evaluation`` or ``str``
      The evaluation functions, default ``[LogLoss]``
  
  loss: ``str``
      The loss used. Default ``nll_loss``.
  
  lr_scheduler_type: ``str`` (Optional)
      The lr scheduler type used. Default None.
class_docstr_tok: ["The","graph","classification","trainer",".","Used","to","automatically","train","the","graph","classification","problem",".","Parameters","--","--","--","--","--","model",":","Models","can","be","``","str","``",",","``","autogl.module.model.BaseAutoModel","``",",","``","autogl.module.model.encoders.BaseEncoderMaintainer","``","or","a","tuple","of","(","encoder",",","decoder",")","if","need","to","specify","both","encoder","and","decoder",".","Encoder","can","be","``","str","``","or","``","autogl.module.model.encoders.BaseEncoderMaintainer","``",",","and","decoder","can","be","``","str","``","or","``","autogl.module.model.decoders.BaseDecoderMaintainer","``",".","If","only","encoder","is","specified",",","decoder","will","be","default","to","``","logsoftmax","''","num_features",":","int","(","Optional",")","The","number","of","features","in","dataset",".","default","None","num_classes",":","int","(","Optional",")","The","number","of","classes",".","default","None","num_graph_features",":","int","(","Optional",")","The","number","of","graph","level","features",".","default","0.","optimizer",":","``","Optimizer","``","of","``","str","``","The","(","name","of",")","optimizer","used","to","train","and","predict",".","default","torch.optim.Adam","lr",":","``","float","``","The","learning","rate","of","node","classification","task",".","default","1e-4","max_epoch",":","``","int","``","The","max","number","of","epochs","in","training",".","default","100","early_stopping_round",":","``","int","``","The","round","of","early","stop",".","default","100","weight_decay",":","``","float","``","weight","decay","ratio",",","default","1e-4","device",":","``","torch.device","``","or","``","str","``","The","device","where","model","will","be","running","on",".","init",":","``","bool","``","If","True","(","False",")",",","the","model","will","(","not",")","be","initialized",".","feval",":","(","Sequence","of",")","``","Evaluation","``","or","``","str","``","The","evaluation","functions",",","default","``","[","LogLoss","]","``","loss",":","``","str","``","The","loss","used",".","Default","``","nll_loss","``",".","lr_scheduler_type",":","``","str","``","(","Optional",")","The","lr","scheduler","type","used",".","Default","None","."]
code: def __init__(
      self,
      model: Union[
          Tuple[BaseEncoderMaintainer, BaseDecoderMaintainer],
          BaseEncoderMaintainer,
          BaseAutoModel,
          str,
      ] = None,
      num_features: int = None,
      num_classes: int = None,
      num_graph_features: int = 0,
      optimizer: Type[torch.optim.Optimizer] = torch.optim.Adam,
      lr: float = 1e-4,
      max_epoch: int = 100,
      batch_size: int = 64,
      num_workers: int = 0,
      early_stopping_round: int = 7,
      weight_decay: float = 1e-4,
      device: Union[str, torch.device] = "auto",
      init: bool = False,
      feval=[Logloss],
      loss="nll_loss",
      lr_scheduler_type=None,
      criterion=None,
      *args,
      **kwargs,
  ):
      if isinstance(model, Tuple):
          encoder, decoder = model
      elif isinstance(model, BaseAutoModel):
          encoder, decoder = model, None
      else:
          encoder, decoder = model, "sumpoolmlp"
  
      super().__init__(
          encoder=encoder,
          decoder=decoder,
          num_features=num_features,
          num_classes=num_classes,
          num_graph_features=num_graph_features,
          last_dim="auto",
          device=device,
          feval=feval,
          loss=loss,
      )
  
      self.opt_received = optimizer
      if isinstance(optimizer, str):
          if optimizer.lower() == "adam":
              self.optimizer = torch.optim.Adam
          elif optimizer.lower() == "sgd":
              self.optimizer = torch.optim.SGD
          else:
              raise ValueError(
                  "Currently not support optimizer {}".format(optimizer)
              )
      elif isinstance(optimizer, type) and issubclass(
          optimizer, torch.optim.Optimizer
      ):
          self.optimizer = optimizer
      else:
          raise ValueError(
              "Currently not support optimizer {}".format(optimizer)
          )
  
      self.lr_scheduler_type = lr_scheduler_type
  
      self.lr = lr
      self.max_epoch = max_epoch
      self.batch_size = batch_size
      self.num_workers = num_workers
  
      if self.num_workers > 0:
          mp.set_start_method("fork", force=True)
  
      self.early_stopping_round = (
          early_stopping_round
          if early_stopping_round is not None
          else 100
      )
  
      self.args = args
      self.kwargs = kwargs
  
      self.weight_decay = weight_decay
  
      self.early_stopping = EarlyStopping(
          patience=early_stopping_round, verbose=False
      )
  
      self.valid_result = None
      self.valid_result_prob = None
      self.valid_score = None
  
      self.pyg_dgl = DependentBackend.get_backend_name()
      self.criterion = criterion
  
      self.hyper_parameter_space = [
          {
              "parameterName": "max_epoch",
              "type": "INTEGER",
              "maxValue": 300,
              "minValue": 10,
              "scalingType": "LINEAR",
          },
          {
              "parameterName": "batch_size",
              "type": "INTEGER",
              "maxValue": 128,
              "minValue": 32,
              "scalingType": "LOG",
          },
          {
              "parameterName": "early_stopping_round",
              "type": "INTEGER",
              "maxValue": 30,
              "minValue": 10,
              "scalingType": "LINEAR",
          },
          {
              "parameterName": "lr",
              "type": "DOUBLE",
              "maxValue": 1e-3,
              "minValue": 1e-4,
              "scalingType": "LOG",
          },
          {
              "parameterName": "weight_decay",
              "type": "DOUBLE",
              "maxValue": 5e-3,
              "minValue": 5e-4,
              "scalingType": "LOG",
          },
      ]
  
      self.hyper_parameters = {
          "max_epoch": self.max_epoch,
          "batch_size": self.batch_size,
          "early_stopping_round": self.early_stopping_round,
          "lr": self.lr,
          "weight_decay": self.weight_decay,
      }
  
      if init is True:
          self.initialize()
  
imports: from .None import register_trainer
  from .base import BaseGraphClassificationTrainer, EarlyStopping
  import torch
  from torch.optim.lr_scheduler import StepLR, MultiStepLR, ExponentialLR, ReduceLROnPlateau
  import torch.nn.functional
  from ..model import BaseAutoModel, BaseDecoderMaintainer, BaseEncoderMaintainer
  from .evaluation import get_feval, Logloss
  from typing import Tuple, Type, Union
  from ...datasets import utils
  from copy import deepcopy
  import torch.multiprocessing
  from ...utils import get_logger
  from ...backend import DependentBackend
label_desc: Use image node_id 1 to create a new GraphClassificationFullTrainer object from inherited base classes: BaseGraphClassificationTrainer with example: obj = GraphClassificationFullTrainer(model, num_features, num_classes, num_graph_features, optimizer, lr, max_epoch, batch_size, num_workers, early_stopping_round, weight_decay, device, init, feval, loss, lr_scheduler_type, criterion)