PyTorch 101: Building A Model Step-by-Step
This course is only available as a part of subscription plans.
Training duration : 90 minutes
DIFFICULTY LEVEL: BEGINNER
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
Instructor Bio:
Daniel Voigt Godoy
Module 1: PyTorch: tensors, tensors, tensors
• 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
• 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
• 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
• 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
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.
CHECK OUT NEW AND FEATURED COURSES