PyTorch Examples
================
This pages lists various PyTorch examples that you can use to learn and
experiment with PyTorch.
.. panels::
Image Classification Using ConvNets
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This example demonstrates how to run image classification
with `Convolutional Neural Networks ConvNets `__
on the `MNIST `__ database.
`GO TO EXAMPLE `__ :opticon:`link-external`
---
Measuring Similarity using Siamese Network
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This example demonstrates how to measure similarity between two images
using `Siamese network `__
on the `MNIST `__ database.
`GO TO EXAMPLE `__ :opticon:`link-external`
---
Word-level Language Modeling using RNN and Transformer
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This example demonstrates how to train a multi-layer `recurrent neural
network (RNN) `__,
such as Elman, GRU, or LSTM, or Transformer on a language
modeling task by using the Wikitext-2 dataset.
`GO TO EXAMPLE `__ :opticon:`link-external`
---
Training ImageNet Classifiers
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This example demonstrates how you can train some of the most popular
model architectures, including `ResNet `__,
`AlexNet `__, and `VGG `__
on the `ImageNet `__ dataset.
`GO TO EXAMPLE `__ :opticon:`link-external`
---
Generative Adversarial Networks (DCGAN)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This example implements the `Unsupervised Representation Learning with Deep Convolutional Generative Adversarial Networks `__ paper.
`GO TO EXAMPLE `__ :opticon:`link-external`
---
Variational Auto-Encoders
^^^^^^^^^^^^^^^^^^^^^^^^^
This example implements the `Auto-Encoding Variational Bayes `__ paper
with `ReLUs `__ and the Adam optimizer.
`GO TO EXAMPLE `__ :opticon:`link-external`
---
Super-resolution Using an Efficient Sub-Pixel CNN
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This example demonstrates how to use the sub-pixel convolution layer
described in `Real-Time Single Image and Video Super-Resolution Using an Efficient Sub-Pixel Convolutional Neural Network `__ paper. This example trains a super-resolution
network on the `BSD300 dataset `__.
`GO TO EXAMPLE `__ :opticon:`link-external`
---
HOGWILD! Training of Shared ConvNets
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
`HOGWILD! `__ is a scheme that allows
Stochastic Gradient Descent (SGD)
parallelization without memory locking. This example demonstrates how
to perform HOGWILD! training of shared ConvNets on MNIST.
`GO TO EXAMPLE `__ :opticon:`link-external`
---
Training a CartPole to balance in OpenAI Gym with actor-critic
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This reinforcement learning tutorial demonstrates how to train a
CartPole to balance
in the `OpenAI Gym `__ toolkit by using the
`Actor-Critic `__ method.
`GO TO EXAMPLE `__ :opticon:`link-external`
---
Time Sequence Prediction
^^^^^^^^^^^^^^^^^^^^^^^^
This beginner example demonstrates how to use LSTMCell to
learn sine wave signals to predict the signal values in the future.
`GO TO EXAMPLE `__ :opticon:`link-external`
---
Implement the Neural Style Transfer algorithm on images
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This tutorial demonstrates how you can use PyTorch's implementation
of the `Neural Style Transfer (NST) `__
algorithm on images.
`GO TO EXAMPLE `__ :opticon:`link-external`
---
PyTorch Module Transformations using fx
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This set of examples demonstrates the torch.fx toolkit. For more
information about `torch.fx`, see
`torch.fx Overview `__.
`GO TO EXAMPLE `__ :opticon:`link-external`
---
Distributed PyTorch
^^^^^^^^^^^^^^^^^^^
This set of examples demonstrates `Distributed Data Parallel (DDP) `__ and `Distributed RPC framework `__.
Includes the code used in the `DDP tutorial series `__.
`GO TO EXAMPLES `__ :opticon:`link-external`
---
C++ Frontend
^^^^^^^^^^^^
The PyTorch C++ frontend is a C++14 library for CPU and GPU tensor computation.
This set of examples includes a linear regression, autograd, image recognition
(MNIST), and other useful examples using PyTorch C++ frontend.
`GO TO EXAMPLES `__ :opticon:`link-external`
---
Image Classification Using Forward-Forward Algorithm
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This example implements the paper `The Forward-Forward Algorithm: Some Preliminary Investigations `__ by Geoffrey Hinton.
on the `MNIST `__ database.
It is an introductory example to the Forward-Forward algorithm.
`GO TO EXAMPLE `__ :opticon:`link-external`
---
Graph Convolutional Network
^^^^^^^^^^^^^^^^^^^^^^^^^^^
This example implements the `Semi-Supervised Classification with Graph Convolutional Networks `__ paper on the CORA database.
`GO TO EXAMPLE `__ :opticon:`link-external`