Skip to content

Introduction to PyTorch

Professor Albert Bifet

  • Framework for Machine Learning.
  • Compare with other popular frameworks like TensorFlow.
  • Consists of two main components

    • Numeric representation optimised for GPUs
    • Deep Learning framework
  • Motivation

    • Deep Learning using Python accelerates the path from research prototyping to production deployment
    • Uses a dynamic computation graph approach
    • Uses hardware accelerators as GPUs
  • Deep Learning

    • Inspired by Biological neural networks, but not the same
    • Construct improved features representing the input problem
    • Combine features to improve network predictive capability
  • Neural Network

    • Example network
  • PyTorch audience

    • Replacement for NumPy - using the power of GPUs
    • Deep Learning research platform providing
      • Speed
      • Flexibility
  • TensorFlow

  • Stochastic Gradient Descent

    • Strategy for updating weights ('learning')
    • Computed automatically within PyTorch
  • Skorch

    • Scikit-Learn wrapper for PyTorch
  • PyTorch example

    • MNIST Dataset (National Institute of Standards and Technology)
    • Classical dataset used within Deep Learning
    • PyTorch data Loading
    • PyTorch model
    • Training & Evaluation
    • Evaluating Training Loss
    • Evaluating Testing Loss
  • TensorFlow

    • Feature contrast with PyTorch
    • Static topology
    • Model building similar to PyTorch