class_docstr: PL Lightning Module for the EfficientAd algorithm.
  
  Args:
      teacher_file_name (str): path to the pre-trained teacher model
      teacher_out_channels (int): number of convolution output channels
      image_size (tuple): size of input images
      model_size (str): size of student and teacher model
      lr (float): learning rate
      weight_decay (float): optimizer weight decay
      padding (bool): use padding in convoluional layers
      pad_maps (bool): relevant if padding is set to False. In this case, pad_maps = True pads the
          output anomaly maps so that their size matches the size in the padding = True case.
      batch_size (int): batch size for imagenet dataloader
class_docstr_tok: ["PL","Lightning","Module","for","the","EfficientAd","algorithm",".","Args",":","teacher_file_name","(","str",")",":","path","to","the","pre-trained","teacher","model","teacher_out_channels","(","int",")",":","number","of","convolution","output","channels","image_size","(","tuple",")",":","size","of","input","images","model_size","(","str",")",":","size","of","student","and","teacher","model","lr","(","float",")",":","learning","rate","weight_decay","(","float",")",":","optimizer","weight","decay","padding","(","bool",")",":","use","padding","in","convoluional","layers","pad_maps","(","bool",")",":","relevant","if","padding","is","set","to","False",".","In","this","case",",","pad_maps","=","True","pads","the","output","anomaly","maps","so","that","their","size","matches","the","size","in","the","padding","=","True","case",".","batch_size","(","int",")",":","batch","size","for","imagenet","dataloader"]
code: def prepare_imagenette_data(self) -> None:
      self.data_transforms_imagenet = A.Compose(
          [  # We obtain an image P ∈ R 3×256×256 from ImageNet by choosing a random image,
              A.Resize(
                  self.image_size[0] * 2, self.image_size[1] * 2
              ),  # resizing it to 512 × 512,
              A.ToGray(
                  p=0.3
              ),  # converting it to gray scale with a probability of 0.3
              A.CenterCrop(
                  self.image_size[0], self.image_size[1]
              ),  # and cropping the center 256 × 256 pixels
              A.ToFloat(always_apply=False, p=1.0, max_value=255),
              ToTensorV2(),
          ]
      )
  
      imagenet_dir = Path("./datasets/imagenette")
      if not imagenet_dir.is_dir():
          download_and_extract(imagenet_dir, IMAGENETTE_DOWNLOAD_INFO)
      imagenet_dataset = ImageFolder(
          imagenet_dir,
          transform=TransformsWrapper(t=self.data_transforms_imagenet),
      )
      self.imagenet_loader = DataLoader(
          imagenet_dataset,
          batch_size=self.batch_size,
          shuffle=True,
          pin_memory=True,
      )
      self.imagenet_iterator = iter(self.imagenet_loader)
  
imports: from __future__ import annotations
  import logging
  from pathlib import Path
  import albumentations
  import numpy
  import torch
  import tqdm
  from albumentations.pytorch import ToTensorV2
  from omegaconf import DictConfig, ListConfig
  from pytorch_lightning.utilities.types import STEP_OUTPUT
  from torch import Tensor, optim
  from torch.utils.data import DataLoader
  from torchvision.datasets import ImageFolder
  from anomalib.data.utils import DownloadInfo, download_and_extract
  from anomalib.models.components import AnomalyModule
  from .torch_model import EfficientAdModel, EfficientAdModelSize, reduce_tensor_elems
label_desc: Use image node_id 3 for calling the EfficientAd obj's underlying member method code with example usage: obj.prepare_imagenette_data() without return types