filmov
tv
PyTorch Tutorial : Introduction to PyTorch
Показать описание
---
Hi, I am Ismail Elezi and I will introduce you to Deep Learning with PyTorch. In this course, we are going to learn the basic concepts of deep learning, a subfamily of machine learning algorithms which has been at the forefront of recent developments in Artificial Intelligence.
You might have heard of successes of image classification, machine translation, autonomous driving, Alpha Go or computer bots defeating professional players in Starcraft (AlphaStar). All of these technologies have been empowered by neural networks, another name for deep learning.
The magic of neural networks compared to traditional models is in the fact that classical models used one algorithm for feature extraction followed by a machine learning classifier, while neural networks do the optimization altogether. The first few layers transform the input into features which are easy to be classified, while the final layer separates the data based on the features which the previous layers have generated.
During the course, we are going to implement many of deep learning central algorithms using the PyTorch library. While the concepts we are going to study are general, the examples we are going to use are mostly computer vision-oriented, as are the datasets.
There are tons of great deep learning libraries right there. We chose PyTorch because of its simplicity because it has strong GPU support and it has already implemented many deep learning algorithms. It having strong OOP support makes a natural choice for many companies like Facebook and Salesforce, while also being one of the most used deep learning libraries in academic research.
Calculating derivatives and gradients is a very important aspect of deep learning algorithms. Luckily PyTorch is very good at doing it for us.
Finally, the library is very similar to NumPy, making the switch from NumPy to PyTorch as painless as possible.
Matrices are very important in neural networks. The weights and the values of nets are stored in matrices, and many of the operations are done in terms of matrix multiplications. We quickly review hot to multiply two matrices. In order to get the first value (58), we multiply the first row of the first matrix, with the first column of the second matrix, adding, in the end, each value. Similarly, you do for the other entries.
Similarly, you can set variables to matrices, and you can check their shape by using .shape function.
Another important operator is element-wise multiplication (where every element in the first matrix is multiplied by the corresponding element in the second matrix), which can be performed in PyTorch via the asterisk (*) operator.
It is easy to convert NumPy arrays to torch tensors, it can be done via function from_numpy(). Similarly, you can convert torch tensors to NumPy arrays via the numpy() function.
We have prepared a summary of matrix operations, so don't hesitate to get back to it if you forget the names of the functions.
Let us practice with the concepts we just learned!
#DataCamp #PyTorchTutorial #DeepLearningwithPyTorch