Learning Objectives

  • Understand the basic building blocks of PyTorch: tensors, autograd, models, optimizers, losses, datasets, and data loaders

  • Identify the basic steps of gradient descent, and how to use PyTorch to make each one of them more automatic

  • Build, train, and evaluate a model using mini-batch gradient descent

Course Abstract

Module 1: PyTorch: tensors, tensors, tensors (15 min)    

• Introducing a simple and familiar example: linear regression   

• Generating synthetic data    

• Tensors: what they are and how to create them

• CUDA: GPU vs CPU tensors    

• Parameters: tensors meet gradients 


Module 2: Gradient Descent in Five Easy Steps (15 min)    

• Step 0: initializing parameters    

• Step 1: making predictions in the forward pass

• Step 2: computing the loss, or “how bad is my model?”    

• Step 3: computing gradients, or “how to minimize the loss?”    

• Step 4: updating parameters    

• Bonus: learning rate, the most important hyper-parameter    

• Step 5: Rinse and repeat 


Module 3: Autograd, your companion for all your gradient needs! (15 min)    

• Computing gradients automatically with the backward method    

• Dynamic Computation Graph: what is that?   

• Optimizers: updating parameters, the PyTorch way    

• Loss functions in PyTorch 


Module 4: Building a Model in PyTorch (15 min)

• Your first custom model in PyTorch    

• Peeking inside a model with state dictionaries

• The importance of setting a model to training mode    

• Nested models, layers, and sequential models

• Organizing our code: the training step 


Module 5: Datasets and data loaders (20 min)   

• Your first custom dataset in PyTorch   

• Data loaders and mini-batches    

• Evaluation phase: setting up the stage   

• Organizing our code: the training loop   

• Putting it all together: data preparation, model configuration, and model training 

• Taking a break: saving and loading models

Instructor's Bio: Daniel Voigt Godoy

Daniel Voigt Godoy has20+ years experience in developing solutions, programs and models using analytical skills across different industries: software development, government, fintech, retail and mobility. 7+ years experience with data processing, data analysis, machine learning and statistical tools: Python (numpy, scipy, pandas, scikit-learn), Spark, R Studio, MatLab and Statistica. Experience in stochastic simulation and agent-based modeling. Experienced programmer in SQL, Python, Java, R, PowerBuilder, PHP. Strong programming skills and eagerness to learn different languages, frameworks and tools. Solid background in statistics, economics, capital markets, debt management and financial instruments.

Who will be interested in this course?

  • This course is for current or aspiring Data Scientists, Machine Learning Engineers, and Deep Learning Practioners

  • Knowledge of following tools and concepts:

  • Python, Jupyter notebooks, Numpy and, preferably, object oriented programming.

  • Basic machine learning concepts may be helpful, but it is not required.