class_docstr: >>> ImageNetLightningModel(data_path='missing')  # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
  ImageNetLightningModel(
    (model): ResNet(...)
  )
class_docstr_tok: [">",">",">","ImageNetLightningModel","(","data_path='missing","'",")","#","doctest",":","+ELLIPSIS","+NORMALIZE_WHITESPACE","ImageNetLightningModel","(","(","model",")",":","ResNet","(","...",")",")"]
code: def __init__(
      self,
      data_path: str,
      arch: str = "resnet18",
      weights: Optional[str] = None,
      lr: float = 0.1,
      momentum: float = 0.9,
      weight_decay: float = 1e-4,
      batch_size: int = 256,
      workers: int = 4,
  ):
      super().__init__()
      self.arch = arch
      self.weights = weights
      self.lr = lr
      self.momentum = momentum
      self.weight_decay = weight_decay
      self.data_path = data_path
      self.batch_size = batch_size
      self.workers = workers
      self.model = get_torchvision_model(
          self.arch, weights=self.weights
      )
      self.train_dataset: Optional[Dataset] = None
      self.eval_dataset: Optional[Dataset] = None
      # ToDo: this number of classes hall be parsed when the dataset is loaded from folder
      self.train_acc1 = Accuracy(
          task="multiclass", num_classes=1000, top_k=1
      )
      self.train_acc5 = Accuracy(
          task="multiclass", num_classes=1000, top_k=5
      )
      self.eval_acc1 = Accuracy(
          task="multiclass", num_classes=1000, top_k=1
      )
      self.eval_acc5 = Accuracy(
          task="multiclass", num_classes=1000, top_k=5
      )
  
imports: import os
  from typing import Optional
  import torch
  import torch.nn.functional
  import torch.nn.parallel
  import torch.optim
  import torch.optim.lr_scheduler
  import torch.utils.data
  import torch.utils.data.distributed
  import torchvision.datasets
  import torchvision.transforms
  from lightning.pytorch import LightningModule
  from lightning.pytorch.callbacks import ModelCheckpoint, TQDMProgressBar
  from lightning.pytorch.cli import LightningCLI
  from lightning.pytorch.strategies import ParallelStrategy
  from lightning.pytorch.utilities.model_helpers import get_torchvision_model
  from torch.utils.data import Dataset
  from torchmetrics import Accuracy
label_desc: Use image node_id 1 to create a new ImageNetLightningModel object from inherited base classes: LightningModule with example: obj = ImageNetLightningModel(data_path, arch, weights, lr, momentum, weight_decay, batch_size, workers)