class_docstr: .. figure:: https://3qeqpr26caki16dnhd19sv6by6v-wpengine.netdna-ssl.com/wp-content/uploads/2017/08/
      Sample-of-Images-from-the-ImageNet-Dataset-used-in-the-ILSVRC-Challenge.png
      :width: 400
      :alt: Imagenet
  Specs:
      - 1000 classes
      - Each image is (3 x varies x varies) (here we default to 3 x 224 x 224)
  Imagenet train, val and test dataloaders.
  The train set is the imagenet train.
  The val set is taken from the train set with `num_imgs_per_val_class` images per class.
  For example if `num_imgs_per_val_class=2` then there will be 2,000 images in the validation set.
  The test set is the official imagenet validation set.
   Example::
      from pl_bolts.datamodules import ImagenetDataModule
      dm = ImagenetDataModule(IMAGENET_PATH)
      model = LitModel()
      Trainer().fit(model, datamodule=dm)
class_docstr_tok: ["..","figure",":",":","https",":","\/\/3qeqpr26caki16dnhd19sv6by6v-wpengine.netdna-ssl.com\/wp-content\/uploads\/2017\/08\/","Sample-of-Images-from-the-ImageNet-Dataset-used-in-the-ILSVRC-Challenge.png",":","width",":","400",":","alt",":","Imagenet","Specs",":","-","1000","classes","-","Each","image","is","(","3","x","varies","x","varies",")","(","here","we","default","to","3","x","224","x","224",")","Imagenet","train",",","val","and","test","dataloaders",".","The","train","set","is","the","imagenet","train",".","The","val","set","is","taken","from","the","train","set","with","`","num_imgs_per_val_class","`","images","per","class",".","For","example","if","`","num_imgs_per_val_class=2","`","then","there","will","be","2,000","images","in","the","validation","set",".","The","test","set","is","the","official","imagenet","validation","set",".","Example",":",":","from","pl_bolts.datamodules","import","ImagenetDataModule","dm","=","ImagenetDataModule","(","IMAGENET_PATH",")","model","=","LitModel","(",")","Trainer","(",")",".fit","(","model",",","datamodule=dm",")"]
docstr: The standard imagenet transforms for validation.
  .. code-block:: python
      transforms.Compose([
          transforms.Resize(self.image_size + 32),
          transforms.CenterCrop(self.image_size),
          transforms.ToTensor(),
          transforms.Normalize(
              mean=[0.485, 0.456, 0.406],
              std=[0.229, 0.224, 0.225]
          ),
      ])
docstr_tok: ["The","standard","imagenet","transforms","for","validation",".","..","code-block",":",":","python","transforms.Compose","(","[","transforms.Resize","(","self.image_size","+","32",")",",","transforms.CenterCrop","(","self.image_size",")",",","transforms.ToTensor","(",")",",","transforms.Normalize","(","mean=","[","0.485",",","0.456",",","0.406","]",",","std=","[","0.229",",","0.224",",","0.225","]",")",",","]",")"]
code: def val_transform(self) -> Callable:
      """The standard imagenet transforms for validation.
      .. code-block:: python
          transforms.Compose([
              transforms.Resize(self.image_size + 32),
              transforms.CenterCrop(self.image_size),
              transforms.ToTensor(),
              transforms.Normalize(
                  mean=[0.485, 0.456, 0.406],
                  std=[0.229, 0.224, 0.225]
              ),
          ])
      """
  
      preprocessing = transforms.Compose(
          [
              transforms.Resize(self.image_size + 32),
              transforms.CenterCrop(self.image_size),
              transforms.ToTensor(),
              imagenet_normalization(),
          ]
      )
      return preprocessing
  
imports: import os
  from pathlib import Path
  from typing import Any, List, Union, Callable, Optional
  from torch.utils.data import Dataset, DataLoader
  from torch.utils.data.dataloader import default_collate
  from torch.utils.data.distributed import DistributedSampler
  from pytorch_lightning import LightningDataModule
  from torchvision import transforms
  from torchvision.datasets import ImageFolder
label_desc: Use image node_id 7 for calling the ImagenetDataModule obj's underlying member method code with example usage: obj.val_transform() and returns: preprocessing