Skip to content

CertifaiAI/Intro_to_Pytorch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction to PyTorch

This repository contains notebooks for hands-on purpose during training session. All notebooks had been tested using CPU.

Contents

  • 1.1 Introduction to Tensors
  • 1.2 Mathematical Operations on Tensors
  • 1.3 Tensor Indexing, Slicing, Joining, Mutating
  • 1.4 Tensor Objects Methods
  • 1.5 Tensors on CPU and GPU
  • 2.1 Introduction to Autograd
  • 2.2 Linear Regression Example
  • 3.1 Dataloader
  • 3.2 Build your First Neural Network (Subclassing nn.Module)
  • 3.3 Build Your First Neural Network (Sequential Model)

Built with

  • PyTorch 1.6.0
  • CUDA 10.2

Getting Started

Install Anaconda Individual Edition

Download and install Anaconda.

Environment Setup

Setup the conda environment by

conda env create -f environment.yml

The environment setup will take some time to download required modules.

GPU Setup (optional)

Follow the instructions below if you plan to use GPU setup.

  1. Install CUDA and cuDNN Requirements:

Step by step installation guides can be found here.

  1. If you like to use different version of CUDA, please install appropriate cudatoolkit module by enter conda install cudatoolkit=CUDA_VERSION
conda install cudatoolkit=10.2

Usage

All examples are separated into training and solution folders.

All notebooks in training folder have few lines commented out so that they can be taught and demonstrated in the class. The solution folder contains the un-commented version for every line of codes.