code: def __init__(self, N_train=8192, N_valid=1024, **kwargs):
      super().__init__(**kwargs)
  
      batch_size = 64
  
      # Load the MNIST Data here
      train_dataset = torchvision.datasets.MNIST(
          root="../../data",
          train=True,
          transform=transforms.ToTensor(),
          download=True,
      )
      test_dataset = torchvision.datasets.MNIST(
          root="../../data",
          train=False,
          transform=transforms.ToTensor(),
      )
  
      train_sampler = torch.utils.data.sampler.SubsetRandomSampler(
          range(N_train)
      )
      validation_sampler = torch.utils.data.sampler.SubsetRandomSampler(
          range(N_train, N_train + N_valid)
      )
  
      self.train_loader = torch.utils.data.DataLoader(
          dataset=train_dataset,
          batch_size=batch_size,
          sampler=train_sampler,
      )
      self.validation_loader = torch.utils.data.DataLoader(
          dataset=train_dataset,
          batch_size=1024,
          sampler=validation_sampler,
      )
  
      self.test_loader = torch.utils.data.DataLoader(
          dataset=test_dataset, batch_size=1024, shuffle=False
      )
  
file_path: HpBandSter/docs/build/html/_downloads/example_5_pytorch_worker.py
imports: import ConfigSpace
  import ConfigSpace.hyperparameters
  from hpbandster.core.worker import Worker
  import logging
label_desc: Use image node_id 1 to create a new PyTorchWorker object from inherited base classes: Worker with example: obj = PyTorchWorker(N_train, N_valid)