The idea of this new series of posts to get you started with Pytorch and to go through with different implementations like neural networks,CNN , RNN etc. I assume that you know the theory part of deep learning. So I will cover the coding with Pytorch in this series.
Now the motivation , why Pytorch ?
Among other reasons which I will describe , first see this tweet from famous deep learning practitioner Andrej Karpathy
- Deep Integration with Python:
The creators of the library say, “Deep integration into Python allows popular libraries and packages to be used for easily writing neural network layers in Python.” Learning curve of Pytorch is also very smooth due the more pythonic approach of coding. - Dynamic Graph Computation:
Jeremy Howard from Fast.ai says, “An additional benefit of Pytorch is that it allowed us to give our students a much more in-depth understanding of what was going on in each algorithm that we covered. With a static computation graph library like TensorFlow, once you have declaratively expressed your computation, you send it off to the GPU where it gets handled like a black box. But with a dynamic approach, you can fully dive into every level of the computation, and see exactly what is going on.”
- Faster than other Deep Learning Library:
In Academia Pytorch gained a huge momentum due to it’s speed and ease of use. Many researchers have shown that Pytorch is much faster when compared to other deep learning library like Tensorflow , Keras
I will encourage you to use Anaconda distribution with Jupyter Notebook to follow along the tutorials.Once you install Anaconda , the distribution creates a base environment which almost has all prerequisites to install Pytorch. For separability create a new environment named ‘deep-learning’ cloning the base environment with below given comment.
conda create –name deep-learning –clone base #to create the new environment
activate deep-learning #to activate the environment.
if you don’t have GPU in your system then run the below code to install the pytorch.
conda install pytorch-cpu torchvision-cpu -c pytorch
This Link can also help you to select the correct installation command according to your system requirement.
In this below shown notebook we will try to understand the basics of the Pytorch.
Do share , like if you this tutorial was helpful for you.