Learning Pytorch in 2025
I want to develop an AI applciation using ESP32-S3 and discover that you need to know some basic kowledege about nerual network.
ESP32 have AI library ESP-DL
, but you need pytorch to train the model.
Therefore, the first step is to learn pytorch and some basic deep learning concept. Otherwise it is very diffcult to code without background knowledge.
How This Blog May Help You
- This blog will give you some importants points and reviews on the youtube video
Learn from youtube:
Link: PyTorch for Deep Learning & Machine Learning – Full Course https://www.youtube.com/watch?v=V_xro1bcAuA
The first 2 chapters
It is a introduction chapters which using a simple example of linear formula to demostrate the work flow of a neuru network.
Basically shows how deep learning works with pytorch, basic naming convention, concept in deep learning and pytorch
He use 8 hours of video for 2 chapters.
- Naming convention: scalar, vector in lower case, MATRIX, TENSOR in upper case. Why? I don’t know. It is just defacto standard.
- Random numbers are important. There are work flow : random number-> look at data-> update random number
- 3 main errors you will face in pytorch
- Incorrect shape: Tensor should have the same shape.
- Incorrect device: what hardware implementation is using on that tensor,
cpu
orcuda
. Error will pop up if two tensor have different device
- Incorrect device: what hardware implementation is using on that tensor,
- Incorrect data type: Erro will pop up if tensor have differernt datatype
tensor.mean()
only accept float and complex datatypenumpy
datatype use float64 by default when convert to tensor- Basic work flow: Input->forward->loss fucction->optimize-> loop
The 3rd and 4th chapters
Introduce other kinds of deep learning: classification, CNNs, and using custom datasets.
- Use sklearn’s
train_test_split
to split the dataset. - A linear formula does not work with non-linear data. Add an activation function to introduce non-linear characteristics.
- Introduction to activation functions.
- Typically, you need a
softmax
function to convert logits to prediction probabilities and then to classification labels.
Review
- This is an excellent video for beginners who do not have much background in neural networks.
- It focuses on coding and workflow, with concise explanations of how neural networks work.
- The instructor demonstrates real-time debugging while implementing the neural network, which is very helpful for understanding the process.
Reference
Arthur’s GitHub link: https://github.com/mrdbourke