Wednesday, September 15, 2021

PyTorch Tutorial A Complete Use Case Example

PyTorch Tutorial: A Complete Use-case Example
Introduction

This tutorial shows a full use-case of PyTorch in order to explain several concepts by example. The application will be hand-written number detection using MNIST. MNIST is a popular (perhaps the most popular) educational computer vision dataset. It is composed of 70K images of hand-written digits (0-9) split into 60K-10K training and test sets respectively. The images are tiny (28x28), which makes them easy to work with.

Contents:
  1. Data loading
    • Loading for tables
    • Loading for text (NLP)
    • Loading for images (CV)
  2. Neural Network building
    • Skeleton
    • Layers
    • Activation functions
  3. ML components
    • Loss functions
    • Optimizer
  4. Training loop
  5. Testing
  6. Saving/loading models
PyTorch Data Loading

When using PyTorch, there are many ways to load your data. It depends mainly on the type of data (tables, images, text, audio, etc.) and the size. Many text datasets are small enough to load into memory in full. Some image datasets (such as MNIST can also be loaded to memory in full due to the small image size. However, in most real-life applications,

(continued...)

from Planet SciPy
read more

No comments:

Post a Comment

TestDriven.io: Working with Static and Media Files in Django

This article looks at how to work with static and media files in a Django project, locally and in production. from Planet Python via read...