yunfei-teng / PyTorch-Tutorial-Spring-2021

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PyTorch Tutorial

PyTorch tutorial codes for course Advanced Machine Learning, NYU Tandon, Spring 2021

Requirements:

Python 3

Pytorch 1.4

Notes:

We have 2 recitations in total:

  1. Intro to Python and PyTorch; Basics up to defining the model and training (different optimizations, setting up batch size and learning rate) and staff necessary to do classification on MNIST with fully-connected and convolutions layers and simple regression;
  2. GANs, ResNets, VisualBackProp, autoencoders, skipped connections and batch normalization.

Recitation 1:

  1. regression: regression for polynomial functions.
  2. classification: MNIST digits classification.

Recitation 2:

  1. autoencder: autoencoder + Unet.
  2. visualbackprop: STL10 image classification + ResNet + VisualBackProp.
  3. gan: generative adversarial nets.

Requirments

Please install PyTorch as indicated. Please be careful about the version of Python, PyTorch and Cuda. I strongly recommend Python3 instead of Python2. Before you run the codes, check whether your machine supports GPU or not.

Run

Run command python3 (name of python file).py

The dataset should be downloaded automatically. STL10 is a large dataset and it may take several minutes.

Homework Tips

  1. You need to modify the codes and add functions like plotting for your homework.
  2. Take care of regression part, because you need to deal with two variables.
  3. Read option.py since you may need to adjust the parameters.

Thanks

All the codes are inspired by PyTorch official examples.

About


Languages

Language:Python 100.0%