The Battle: TensorFlow vs. Pytorch
Which machine learning framework should you use? An answer from 3,000 developers.
Join the DZone community and get the full member experience.
Join For Freewho hasn’t heard about the battle between facebook’s pytorch and google’s tensorflow ? a quick search will reveal the intensity of this clash of frameworks. here is one great article by kirill dubovikov .
at its core, the duel is fuelled by the similarity of the two frameworks. both frameworks:
- are open source libraries for high-performance numerical computation
- are supported by large tech companies
- have strong and active supporting communities
- are python-based
- use graphs to represent the flow of data and operations
- are well documented
taking all of this into account, we can say that almost anything created in one of the frameworks can be replicated in the other at a similar cost. therefore, the question stands.
which framework should you use? what is the main difference between each community?
at /data , we are constantly surveying the developer community to track the trends and predict the future of different technology sectors. for machine learning, in particular, this clash is critical. the prevailing framework, if there is one, will have a huge impact on the path that the machine learning community will take in the years to come.
with this in mind, we asked the developers who said that they are involved in data science (ds) or machine learning (ml) which of the two frameworks they are using, how they are using them, and what else they do in their professional life.
tensorflow is winning the game, but is pytorch playing on the same console?
from the 3,000 developers involved in ml or ds, we saw that 43 percent of them use pytorch or tensorflow.
this 43 percent is not equally distributed between the two frameworks. tensorflow is 3.4 times bigger than pytorch. a total of 86 percent of ml developers and data scientists said they are currently using tensorflow, while only 11 percent were using pytorch.
moreover, pytorch has more than 50 percent of its community also using tensorflow. on the other hand, only 15 percent of the tensorflow community also uses pytorch. it would seem like tensorflow is a must, but pytorch is a nice-to-have.
who is using pytorch and who is using tensorflow? what is each framework being used for the most?
here are the things that really stood out from the rest:
it is conclusive. in comparison to pytorch, tensorflow is being used in production and most probably deployed to the cloud as implied by the significantly higher backend experience of tensorflow users (4.8 years vs. 3.8 of pytorch users). as compared to pytorch, its community is composed more of professional machine learning developers (28 percent), software architects (26 percent), and programmers within a company (58 percent). this is most likely due to google’s focus on deployment through apis such as tensorflow serving , which has become a key motivator for the adoption of tensorflow for many developers who are trying to push data products into production environments.
on the other hand, pytorch is being used more than tensorflow for data analysis and ad-hoc models within a business context (10 percent). in the pytorch community, there are far more python-first developers (i.e developers using python as a primary language) who work on web applications (46 percent). moreover, the versatility of this pythonic framework allows researchers to test out ideas with almost zero friction and therefore, it’s the go-to framework for the most advanced cutting edge solutions.
interested in more insights about machine learning developers and data scientists? get in touch !
Opinions expressed by DZone contributors are their own.
Comments