class_docstr: ### Dataset to load images
class_docstr_tok: ["#","#","#","Dataset","to","load","images"]
docstr: #### Initialize the dataset
  
  * `dataset_name` is the name of the dataset
  * `transforms_` is the set of image transforms
  * `mode` is either `train` or `test`
code: def __init__(self, dataset_name: str, transforms_, mode: str):
      """
      #### Initialize the dataset
  
      * `dataset_name` is the name of the dataset
      * `transforms_` is the set of image transforms
      * `mode` is either `train` or `test`
      """
      # Dataset path
      root = lab.get_data_path() / "cycle_gan" / dataset_name
      # Download if missing
      if not root.exists():
          self.download(dataset_name)
  
      # Image transforms
      self.transform = transforms.Compose(transforms_)
  
      # Get image paths
      path_a = root / f"{mode}A"
      path_b = root / f"{mode}B"
      self.files_a = sorted(str(f) for f in path_a.iterdir())
      self.files_b = sorted(str(f) for f in path_b.iterdir())
  
imports: import itertools
  import random
  import zipfile
  from typing import Tuple
  import torch
  import torch.nn
  import torchvision.transforms
  from PIL import Image
  from torch.utils.data import DataLoader, Dataset
  from torchvision.transforms import InterpolationMode
  from torchvision.utils import make_grid
  from labml import lab, tracker, experiment, monit
  from labml.configs import BaseConfigs
  from labml.utils.download import download_file
  from labml.utils.pytorch import get_modules
  from labml_helpers.device import DeviceConfigs
  from labml_helpers.module import Module
label_desc: Use image node_id 2 to create a new ImageDataset object from inherited base classes: Dataset with example: obj = ImageDataset(dataset_name, transforms_, mode)