PyTorch tutorial codes for course Advanced Machine Learning, NYU Tandon, Spring 2020
Python 3
Pytorch 1.4
We have 2 recitations in total:
- 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;
- GANs, ResNets, VisualBackProp, autoencoders, skipped connections and batch normalization.
- regression: regression for polynomial functions.
- classification: MNIST digits classification.
- autoencder: autoencoder + Unet.
- visualbackprop: STL10 image classification + ResNet + VisualBackProp.
- gan: generative adversarial nets.
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 command python3 (name of python file).py
The dataset should be downloaded automatically. STL10
is a large dataset and it may take several minutes.
- You need to modify the codes and add functions like plotting for your homework.
- Take care of regression part, because you need to deal with two variables.
- Read
option.py
since you may need to adjust the parameters.
All the codes are inspired by PyTorch official examples.