Skip main navigation

New offer! Get 30% off one whole year of Unlimited learning. Subscribe for just £249.99 £174.99. New subscribers only. T&Cs apply

Find out more

Practical: Datasets and dataloaders

A link to a Colab notebook, which uses PyTorch Dataset and Dataloader objects to train a deep learning network on the MNIST hand-written digits data.
A six row by nine column grid of images of random handwritten digits between zero and nine, using a purple background to yellow digit colour map
© The University of Nottingham
How to use datasets and dataloaders in PyTorch.

In the linked Colab notebook we will demonstrate PyTorch datasets and dataloaders using the MNIST handwritten digits dataset included with PyTorch. We’ll then use our exisinting network and training code to train our network using this data.

In the notebook we will cover the following:

  • PyTorch datasets, in particular the MNIST dataset
  • PyTorch dataloaders
  • using datasets and dataloaders with our existing code
  • training and testing the network using the MNIST data.

Follow the link below and work through the Colab notebook step by step.

Datasets and dataloaders

You may wish to open the link in a new browser tab so you can refer back here quickly.

Please leave any questions or comments below.

This article is from the free online

Deep Learning for Bioscientists

Created by
FutureLearn - Learning For Life

Reach your personal and professional goals

Unlock access to hundreds of expert online courses and degrees from top universities and educators to gain accredited qualifications and professional CV-building certificates.

Join over 18 million learners to launch, switch or build upon your career, all at your own pace, across a wide range of topic areas.

Start Learning now