StatML 2020/2021 CDT Introduction to PyTorch tutorial
This repository contains 3 notebooks
01-introduction.ipynb
: Introduction to the fundamentals of PyTorch and automatic differentation02-deep-kernel-learning-challenge-student.ipynb
: Hands-on implementation of deep kernel learning with PyTorch03-dataloading-with-pytorch.ipynb
: Basics of dataloading pipelines with PyTorch
For this tutorial, you are roughly going to need a Jupyter kernel with torch
, gpytorch
, torchvision
, and usual scientific libraries installed. If your usual python environment already has all of this, you can go ahead and use it. Otherwise, follow the below instruction to set up an environment.
Code implemented with python>=3.6
. Instructions written for 3.8.0 but can easily be adapted to your favorite python version.
$ git clone https://github.com/shahineb/statml-cdt-pytorch-tutorial.git
$ cd statml-cdt-pytorch-tutorial
Create and activate a dedicated environment with your favorite virtual environment management tool.
With virtualenv :
$ virtualenv --python=python3.8 venv-pytorch-tutorial
$ source venv-pytorch-tutorial/bin/activate
$ (venv-pytorch-tutorial)
With pyenv :
$ pyenv virtualenv 3.8.0 venv-pytorch-tutorial
$ pyenv activate venv-pytorch-tutorial
$ (venv-pytorch-tutorial)
With conda :
$ conda create --name venv-pytorch-tutorial python=3.8
$ source activate venv-pytorch-tutorial
$ (venv-pytorch-tutorial)
$ (venv-pytorch-tutorial) pip install -r requirements.txt
$ (venv-pytorch-tutorial) python -m ipykernel install --user --name pytorch-tutorial --display-name "pytorch-tutorial"
You can now choose kernel named pytorch-tutorial
from Jupyter.