Este repositório contém snippets e rascunhos de código que foram reunidos durante meus estudos sobre machine learning. Todo o material é feito em Python e está organizado de acordo com a biblioteca principal utilizada.
Tutorial: PyTorch for Deep Learning & Machine Learning – Full Course
Chapter 0 – PyTorch Fundamentals
28/07/2025Why use machine/deep learning?28/07/2025The number one rule of ML28/07/2025Machine learning vs deep learning28/07/2025Anatomy of neural networks28/07/2025Different learning paradigms28/07/2025What can deep learning be used for?28/07/2025What is/why PyTorch?28/07/2025What are tensors?28/07/2025Outline28/07/2025How to (and how not to) approach this course28/07/2025Important resources29/07/2025Getting setup29/07/2025Introduction to tensors29/07/2025Creating random tensors in PyTorch29/07/2025Creating tensors with zeros and ones in PyTorch29/07/2025Creating tensors in a range29/07/2025Tensor datatypes29/07/2025Getting tensor attributes (information about tensors)30/07/2025Manipulating tensors (tensor operations)30/07/2025Matrix multiplication (part 1)30/07/2025Matrix multiplication (part 2: the two main rules of matrix multiplication)30/07/2025Matrix multiplication (part 3: dealing with tensor shape errors)02/08/2025Finding the min, max, mean and sum of tensors (tensor aggregation)02/08/2025Finding the positional min and max of tensors02/08/2025Reshaping, viewing and stacking tensors02/08/2025Squeezing, unsqueezing and permuting tensors02/08/2025Selecting data from tensors (indexing)02/08/2025PyTorch and NumPy02/08/2025PyTorch reproducibility (taking the random out of random)02/08/2025Different ways of accessing a GPU in PyTorch02/08/2025Setting up device agnostic code and putting tensors on and off the GPU- PyTorch Fundamentals exercises & extra-curriculum
Chapter 1 – PyTorch Workflow
03/08/2025Introduction to PyTorch Workflow03/08/2025Getting setup for the PyTorch Workflow module03/08/2025Creating a simple dataset using linear regression03/08/2025Splitting our data into training and test sets (possibly the most important concept in machine learning)03/08/2025Building a function to visualize our data03/08/2025Creating our first PyTorch model for linear regression03/08/2025Breaking down what's happening in our PyTorch linear regression model03/08/2025Discussing some of the most important PyTorch model building classes04/08/2025Checking out the internals of our PyTorch model04/08/2025Making predictions with our random model using torch.inference_mode()04/08/2025Training a model with PyTorch (intuition building)04/08/2025Setting up a loss function and optimizer with PyTorch05/08/2025PyTorch training loop steps and intuition05/08/2025Writing code for a PyTorch training loop05/08/2025Reviewing the steps in a PyTorch trainig loop05/08/2025Running our training loop epoch by epoch and seeing what happens05/08/2025Writing testing loop code and discussing what's happening05/08/2025Reviewing what happens in a testing loop step by step06/08/2025Writing code to save a PyTorch model06/08/2025Writing code to load a PyTorch model07/08/2025Getting ready to practice everything we've done so far with device agnostic-code07/08/2025Putting everything together part 1: preparing data07/08/2025Putting everything together part 2: building a model07/08/2025Putting everything together part 3: training a model07/08/2025Putting everything together part 4: making predictions with a trained model07/08/2025Putting everything together part 5: saving and loading a trained model- PyTorch Workflow exercises & extra-curriculum
Chapter 2 – PyTorch Neural Network Classification
08/08/2025Introduction to machine learning classification with PyTorch08/08/2025Classification problem input and output shapes08/08/2025Typically architecture of a classification neural network (overview)09/08/2025Making a toy classification dataset09/08/2025Turing our data into tensors and making a training and test split09/08/2025Laying out steps for modelling and setting up device agnostic code09/08/2025Coding a small neural network to handle our classification data09/08/2025Making our neural network visual09/08/2025Recreating our model usingtorch.nn.Sequential- Setting up a loss function, optimizer and evaluation function for our classification neural network
- From model logits to prediction probabilities to prediction labels
- Train and test loops
- Discussing options to improve a model
- Creating a straight line dataset
- Evaluating our model's predictions
- The missing piece – non-linearity
- Putting it all together with a multiclass problem
- Troubleshooting a mutli-class model
Chapter 3 – Computer Vision
- Introduction to computer vision
- Computer vision input and outputs
- What is a convolutional neural network?
- TorchVision
- Getting a computer vision dataset
- Mini-batches
- Creating DataLoaders
- Training and testing loops for batched data
- Running experiments on the GPU
- Creating a model with non-linear functions
- Creating a train/test loop
- Convolutional neural networks (overview)
- Coding a CNN
- Breaking down nn.Conv2d/nn.MaxPool2d
- Training our first CNN
- Making predictions on random test samples
- Plotting our best model predictions
- Evaluating model predictions with a confusion matrix
Chapter 4 – Custom Datasets
- Introduction to custom datasets
- Downloading a custom dataset of pizza, steak and sushi images
- Becoming one with the data
- Turning images into tensors
- Creating image DataLoaders
- Creating a custom dataset class (overview)
- Writing a custom dataset class from scratch
- Turning custom datasets into DataLoaders
- Data augmentation
- Building a baseline model
- Getting a summary of our model with torchinfo
- Creating training and testing loop functions
- Plotting model 0 loss curves
- Overfitting and underfitting
- Plotting model 1 loss curves
- Plotting all the loss curves
- Predicting on custom data
Links úteis: