Skip to content

Introduction to PyTorch

PyTorch is a ML framework that provides NumPy-like tensor computation together with the fundamental building blocks for constructing and training deep learning models.

Demo Objectives

  • How to manipulate tensors - i.e., PyTorch as an alternative to NumPy.
  • How to use auto-differentiation and minimise arbitrary functions with gradient descent.
  • How to create custom data loaders for efficient model training.
  • How to build and train ML models from first principles - linear and logistic regression.
  • How to build and train a deep learning model for image classification.
  • How the PyTorch Lightening framework streamlines the deep learning workflow.

Running the Demo

This demo spans several Jupyter notebook:

  • demos/pytorch/tensors.ipynb.
  • demos/pytorch/linear_regression.ipynb.
  • demos/pytorch/logistic_regression.ipynb.
  • demos/pytorch/MNIST.ipynb.
  • demos/pytorch/MNIST_pytorch_lightning.ipynb.

Make sure you have the necessary Python package requirements installed into a Jupyter kernel for it to run successfully.