class_docstr: Trainer that is used for classification.
  
  Parameters
  ----------
  criterion : nn.Module
      Class for criterion module (not an instance). default: ``nn.CrossEntropyLoss``
  learning_rate : float
      Learning rate. default: 0.001
  weight_decay : float
      L2 weight decay. default: 0
  optimizer : Optimizer
      Class for optimizer (not an instance). default: ``Adam``
  train_dataloders : DataLoader
      Used in ``trainer.fit()``. A PyTorch DataLoader with training samples.
      If the ``lightning_module`` has a predefined train_dataloader method this will be skipped.
  val_dataloaders : DataLoader or List of DataLoader
      Used in ``trainer.fit()``. Either a single PyTorch Dataloader or a list of them, specifying validation samples.
      If the ``lightning_module`` has a predefined val_dataloaders method this will be skipped.
  trainer_kwargs : dict
      Optional keyword arguments passed to trainer. See
      `Lightning documentation <https://pytorch-lightning.readthedocs.io/en/stable/common/trainer.html>`__ for details.
class_docstr_tok: ["Trainer","that","is","used","for","classification",".","Parameters","--","--","--","--","--","criterion",":","nn.Module","Class","for","criterion","module","(","not","an","instance",")",".","default",":","``","nn.CrossEntropyLoss","``","learning_rate",":","float","Learning","rate",".","default",":","0.001","weight_decay",":","float","L2","weight","decay",".","default",":","0","optimizer",":","Optimizer","Class","for","optimizer","(","not","an","instance",")",".","default",":","``","Adam","``","train_dataloders",":","DataLoader","Used","in","``","trainer.fit","(",")","``",".","A","PyTorch","DataLoader","with","training","samples",".","If","the","``","lightning_module","``","has","a","predefined","train_dataloader","method","this","will","be","skipped",".","val_dataloaders",":","DataLoader","or","List","of","DataLoader","Used","in","``","trainer.fit","(",")","``",".","Either","a","single","PyTorch","Dataloader","or","a","list","of","them",",","specifying","validation","samples",".","If","the","``","lightning_module","``","has","a","predefined","val_dataloaders","method","this","will","be","skipped",".","trainer_kwargs",":","dict","Optional","keyword","arguments","passed","to","trainer",".","See","`","Lightning","documentation","<","https",":","\/\/pytorch-lightning.readthedocs.io\/en\/stable\/common\/trainer.html",">","`","__","for","details","."]
code: def __init__(
      self,
      criterion: Type[nn.Module] = nn.CrossEntropyLoss,
      learning_rate: float = 0.001,
      weight_decay: float = 0.0,
      optimizer: Type[optim.Optimizer] = optim.Adam,
      train_dataloader: Optional[DataLoader] = None,
      val_dataloaders: Union[DataLoader, List[DataLoader], None] = None,
      **trainer_kwargs,
  ):
      module = _ClassificationModule(
          criterion=criterion,
          learning_rate=learning_rate,
          weight_decay=weight_decay,
          optimizer=optimizer,
      )
      super().__init__(
          module,
          Trainer(use_cgo=True, **trainer_kwargs),
          train_dataloader=train_dataloader,
          val_dataloaders=val_dataloaders,
      )
  
imports: import warnings
  from typing import Dict, List, Optional, Union, Type
  import torch.nn
  import torch.optim
  import torchmetrics
  from torch.utils.data import DataLoader
  import nni
  from ..lightning import LightningModule, _AccuracyWithLogits, Lightning
  from .trainer import Trainer
label_desc: Use image node_id 1 to create a new Classification object from inherited base classes: Lightning with example: obj = Classification(criterion, learning_rate, weight_decay, optimizer, train_dataloader, val_dataloaders)