top of page
Search

Tensorflow vs Pytorch

  • Writer: Abhay Sri
    Abhay Sri
  • Apr 14, 2021
  • 2 min read

When I was first introduced to the concept of machine learning, TensorFlow was the industry standard. I was shown it by YouTube videos, and I didn't really know any other machine learning library. However, I did realize that Tensorflow was particularly hard to learn for beginners, and visualizing some of the concepts proved to be difficult. Fortunately, I was recently introduced to an up-an-coming machine learning library called Pytorch. Pytorch uses more optimized algorithms, and has a flatter learning curve. So far, I have enjoyed learning and using Pytorch, and so I am making this blog to showcase some of the pros and cons of each.


Tensorflow Pros

1 - Visualizations. The visualizations using seaboard/matplotlib along with Tensorflow make it very easy to see loss and other important graphs. All it took was one YouTube tutorial and I quickly picked it up.

2 - Open Source. Tensorflow is open source, which means that people can branch off the main library and create their own versions, or request/add features to new updates. This means that it is constantly evolving and getting better with each update. Tensorflow has a huge community of people working constantly to bring new features and more optimized algorithms.


Tensorflow Cons

1 - Steep Learning Curve. As mentioned before, Tensorflow does have a steep learning curve. Even after watching multiple YouTube and programming tutorials, I could not figure out some of the concepts. Almost all of the content on Tensorflow out there tells you how to do something, but it does not tell you how to adapt it to what you want to do, or why you are doing it. Nevertheless, once you grasp the concepts, you can start to appreciate the complexities and variability of Tensorflow.


Pytorch Pros

1 - Small Learning Curve. If you understand Python, you will have no trouble picking up and excelling using Pytorch. Much of Pytorch code is written like Python, and the YouTube tutorials covering Pytorch are incredibly detailed and not overwhelming.

2 - Open Source. Like Tensorflow, Pytorch is also open-source. However, the community is much smaller than that of Tensorflow's.

3 - Highly Optimized Algorithms - The reason many people are picking up Pytorch instead of Tensorflow is because of the former's optimized learning algorithms. The same machine learning model in Pytorch will take much less time than if it was coded and executed using Tensorflow.


Pytorch Cons

1 - Lack of Documentation. This one is well known by programmers. People have noticed that not all methods and parameters are included in the Pytorch documentation. This leads to some confusion with new people who would like to learn more about certain methods. However, this is something that will likely be fixed, as thousands of people are working on Pytorch everyday to make sure that the documentation and the algorithms are up to par.


In conclusion, both Pytorch and Tensorflow are great machine learning libraries, each with their own pros and cons. However, Pytorch is newer and has better pros vs. cons than Tensorflow. As a result, I will be using Pytorch in my future projects!

 
 
bottom of page