1. Learn
  2. /
  3. Courses
  4. /
  5. Scalable AI Models with PyTorch Lightning

Connected

Exercise

Creating a train DataLoader

Now that we have split our dataset, we need to define a data loader to provide batches of data during training. DataLoader efficiently loads data into memory and allows shuffling for better generalization. In this exercise, you'll complete the train_dataloader method.

Instructions

100 XP
  • Import the DataLoader.
  • Return a DataLoader that loads self.train_data, enabling shuffling for better generalization.