I wanted to learn deep learning, and did not know where to start. Luckily, I found the right video. Thank you Daniel, the way you taught to code and PyTorch was very informative and fun at the same time.
hey guys i had hardcoded the same code but the issue is my question is that the model accuracy is 30% and test accuracy is 83% what is wrong i have not understood? if anybody knows pls tell me. Big thanks to @Dianel Bourke . Love from India.♥
Hi Daniel! I did the complete machine learning and data science bootcamp and it was great, I'm looking foward to learn more about deep learning :) I landed a data analyst job but I'm really looking foward to work in the machine learning field and I guess almost everything you put in this video is what I'm missing. Thank you so much
It is absolutely amazing such a good resource is free! Also, for 13:50:00 I beleive torch metrics has changed, you need to specify `task='multiclass', num_classes=4`
Hello Daniel Bourke, do you sometimes write machine learning algorithms from scratch instead of importing machine learning packages like Scikit-learn ,Keras ,Tensorflow?
Thanks Daniel, so much to love about this video. Firstly I love this is true Python open-source code and not frameworks chained together. The delivery style works perfectly for me, with occasional offshoots to related, though not required, subjects of interest. Your thoughts and advice along with extensive notes build the perfect all-round package. Please Please do more on LLM optimization techniques you suggested and any other in-depth subject you care to share like embedding.
🎯 Key Takeaways for quick navigation: 01:25:10 *⚠️ Google Colab may provide warnings about GPU usage and may reset after a few hours, requiring users to rerun cells.* 02:01:16 *🔄 PyTorch tensors' data type can be changed using the `.type()` method or by directly assigning a new data type, such as `torch.float16` or `torch.half`, to the tensor.* 02:34:54 *🛠️ Dealing with shape errors in neural networks often involves manipulating tensor shapes, such as transposing matrices in PyTorch.- **02:16:41** 🧠 Understanding matrix multiplication is crucial for deep learning.* 02:41:05 *🔍 Transposing tensors retains information while rearranging dimensions, facilitating matrix multiplication.* 03:08:11 *📚 Using the `torch.stack` function: Concatenates tensors along a new dimension, useful for stacking tensors vertically or horizontally.* 03:41:37 *🔍 Navigating reproducibility in PyTorch: Reproducibility ensures consistent results across different runs. Setting a random seed in PyTorch can help achieve reproducibility, influencing the pseudo-randomness in computations.* 04:00:56 *🎮 Device agnostic code: Set up code to run on GPU if available, else default to CPU.* 04:51:36 *🧠 Machine learning models aim to learn patterns from training data to predict outcomes accurately for test data.* 05:26:22 *🔢 PyTorch models initialize parameters with random values, a fundamental principle of deep learning. These values are then adjusted through training to improve model performance.- **05:07:45** 🧠 PyTorch automates key processes like gradient tracking and parameter initialization, allowing focus on model development.* 05:26:22 *🎲 Initializing models with random parameters is fundamental to machine learning and deep learning; gradual adjustment via optimization improves model fit to data.* 05:45:06 *📉 Loss functions, also called cost or criterion functions, measure how wrong a model's predictions are, with lower values indicating better performance.* 06:22:39 *🤯 PyTorch automates backpropagation and gradient descent, simplifying training loop implementation.* 06:47:18 *📊 After training for 10 epochs, the instructor challenges viewers to train for 100 epochs and evaluate predictions.* 06:48:41 *🔄 By running the training code for 100 epochs, the loss decreases significantly, improving model predictions.* 07:04:06 *🌈 Colorful visualizations can enhance understanding in machine learning tutorials.* 07:28:22 *📝 PyTorch offers flexibility in saving models locally or on Google Drive, providing various options for workflow convenience.* 07:32:50 *🧩 Loading a PyTorch model involves instantiating a new instance of the model class and loading the saved state dictionary into it.* 07:34:50 *🔄 Equivalence of loaded and original models can be tested by comparing their predictions, ensuring successful model loading.* 07:52:50 *🔧 Leveraging pre-existing layers: PyTorch's `nn` module provides pre-built layers like `nn.Linear`, simplifying the implementation of neural network components.* 08:02:11 *💻 Setting device for model: Assigning the target device, such as GPU or CPU, ensures that the model operates on the desired hardware.* 08:11:38 *📉 Evaluating model performance: Evaluating a model includes examining its learned parameters to assess how well it fits the training data.* 08:50:29 *🛠️ The architecture of a classification model includes input layer shape, hidden layers with activation functions, output layer shape, loss function, and optimizer choice.* 09:00:20 *📊 scikit-learn, a popular machine learning library, is utilized to create custom data sets in Google Colab.* 09:09:42 *📏 Understanding input and output shapes is vital for avoiding common errors in machine learning models.* 10:32:26 *🧠 Functionizing the code for the training loop will be done later, but for now, the training loop will be written out in full.* 10:35:41 *💡 The `nn.BCEWithLogitsLoss` combines a sigmoid layer and BCE loss into one class, offering more numerical stability.* 10:36:11 *🎯 `nn.BCEWithLogitsLoss` expects raw logits as input for numerical stability, distinguishing it from `nn.BCELoss`.* 10:49:57 *💻 Automating the download of helper functions from a repository enhances code reproducibility and ease of use.* 10:56:10 *📉 Straight-line models struggle with circular data, highlighting the need for more complex model architectures.* 11:21:16 *🧮 During testing, ensure the model is set to evaluation mode and use torch.sigmoid to convert logits to prediction probabilities for binary classification.* 11:45:19 *🛠️ Errors like CUDA device type tensor to numpy can arise due to device inconsistencies, requiring CPU conversion.* 11:46:42 *🎯 Linear models may fail with non-linear data, necessitating non-linear activations for effective learning.* 13:16:54 *🧮 To convert model logits (raw outputs) to prediction probabilities in multi-class classification, use the softmax function.* 13:39:12 *📉 Loss decreases and accuracy increases during model training, indicating progress in multi-class classification.* 14:14:24 *📊 The process of solving computer vision problems involves numerical encoding of images, fitting data into a machine learning model, and shaping outputs to match specific problem requirements.* 14:19:43 *📐 Understanding input and output shapes in computer vision tasks is crucial, with variations like color channel order (NHWC vs. NCHW) requiring attention and adjustment in code.* 14:36:48 *📦 PyTorch's torchvision provides essential libraries for computer vision tasks, including datasets, models, and transforms.* 15:08:46 *🖥️ When preparing data loaders in PyTorch, consider parameters like batch size, shuffle, and number of workers for efficient data loading.* 15:11:51 *🤖 Data loaders in PyTorch facilitate efficient handling of datasets by creating iterable batches for training and testing data.* 15:51:31 *🔄 Disconnects in online environments like Google Colab can interrupt experiments, but rerunning cells and using checkpoints can mitigate data loss.* 16:05:26 *💡 Troubleshooting indentation errors: Even a single space misalignment can lead to errors, so ensure proper alignment in code blocks.* 16:21:58 *📊 Model performance metrics like accuracy and loss can be organized and stored in dictionaries, facilitating easy comparison across different models.* 16:25:44 *🖥️ Setting up device agnostic code ensures seamless switching between GPU and CPU, optimizing model training based on available hardware.* 17:02:34 *🔄 Comparing training times between CPU and GPU helps identify hardware-specific performance variations and optimizes resource utilization.* 17:22:17 *🏗️ CNN architectures consist of multiple blocks, each comprising multiple layers, allowing for deeper models capable of learning intricate features from data.* 17:37:55 *📝 Replicating known architectures and testing them with data helps validate and understand their effectiveness in new contexts.* 17:50:54 *🧠 Convolutional layers aim to compress input data into representations that capture generalizable patterns rather than memorizing exact patterns.* 17:55:19 *🖥️ Experimenting with different parameters like kernel size, stride, and padding in convolutional layers can help understand their impact on output dimensions and feature extraction.* 18:40:46 *🖥️ Training time can vary based on hardware. Ensure consistency in results by checking random seeds and consider hardware differences when comparing training times.* 20:20:49 *📦 PyTorch's `torchvision.datasets` provides standardized ways to handle various data types, like image folder datasets.* 20:29:15 *🎲 Utilizing randomness in data exploration can provide insights and ensure a thorough understanding of the dataset.* 21:24:46 *🛠️ Replicating the functionality of built-in data loaders can be beneficial for custom data sets. Building a custom data loading function provides flexibility and is valuable for cases where pre-built functions are unavailable.* 21:26:00 *🔍 Creating a custom data set involves several key functionalities, including loading images from files, retrieving class names, and organizing classes into dictionaries for easy access.* 21:44:08 *📦 Subclassing `torch.utils.data.Dataset` allows for the creation of custom data sets tailored to specific needs. Key steps include initialization, defining attributes, loading images, and implementing methods like `__len__` and `__getitem__`.* 21:51:09 *🖥️ Utilizing previously created functions streamlines the process of setting up class attributes like classes and class to idx.* 22:38:25 *🔄 Data augmentation strategies, like model selection, should be experimented with to find what works best for your specific problem.* 23:47:43 *📉 Model accuracy on both training and test datasets is about 40% and 50% respectively, suggesting room for improvement.* 25:09:23 *🛠️ Adding a batch dimension to images before passing them through the model is necessary for proper inference.* Made with HARPA AI
I see the whole video and I didn't expect that we are using a pretrained model for that 😢 I am watching because your title said from the start , for that we can directly use the model like gpt 2 or other that will work in less then 10 lines of code 😕
I believe there's a minor mistake in 28. PyTorch and NumPy with respect to the independence of the memory when converting back and forth. I got the following results on colab: [79] import torch import numpy as np array = np.arange(1.0, 8.0) tensor = torch.from_numpy(array) array,tensor (array([1., 2., 3., 4., 5., 6., 7.]), tensor([1., 2., 3., 4., 5., 6., 7.], dtype=torch.float64)) [82] array[0] = 5 [83] array array([5., 2., 3., 4., 5., 6., 7.]) [84] tensor tensor([5., 2., 3., 4., 5., 6., 7.], dtype=torch.float64) Cheers, appreciate all the work that went into this.
A year ago I came here, being unable to create a tensor. Next month I fly to CVPR with thousands of lines of pytorch in my bag. Damn where can I donate?
Thank you very much as always. Though out of the context of tis video, i was wondering what would be the replacement for Tensorflow examination Certificate since it would be discontinues on 31st of may this year ? and also , would be possible to make video about the available Certificates online ? since your expertise opinion on each Certificate would be Gold ! thank you
thanks a lot for this video, i tried many diff videos on yt and yet none of them worked but i successfully installed tf using ur video, really glad i fond this video
Looks like some pics are wrong. Found a picture of fries 🍟 in the "pizza_steak_sushi\train\pizza\2785084.jpg", and a cup ☕ of something also "pizza_steak_sushi\train\pizza\3821701.jpg".