PyTorch or TensorFlow?

Aleksa Gordić - The AI Epiphany · Advanced ·📰 AI News & Updates ·5y ago

Key Takeaways

The video compares PyTorch and TensorFlow, discussing their history, research community adoption, and production deployment, highlighting the trade-offs between the two frameworks.

Full Transcript

five years ago if you ask me this same question which deep learning framework should i use i'll be telling you about six deep learning frameworks mxnet cntk chainer keras tiano and cafe fast forward to 2020 uh they are pretty much all dead and the only two frameworks that matter are tensorflow and pytorch unless if you're developing some uh exotic jvm deep learning applications you'll be using dl4j okay so let's briefly go through the history of how both frameworks both by torch and tensorflow came to be so using google trends here we can see that the initial release of tensorflow happened in november 2015 and we had a huge spike here as it was probably uh like heavily hyped as the whole deep learning field currently is and then we had some busts here so fast forward a year later uh pytorch uh was initially released in i think september 2016 and by then tensorflow already gained a lot of traction as you can see here and it took a while but fast forward to 2020 they pretty much converged here let's briefly go into the worldwide view here and you can see the tensorflow is still more popular than than pytorch also if we take a look at github repos uh tensorflow's got uh 148k stars and uh whereas pi torch has around 50k uh stars now looking at this data from google trends and github you may say well okay like uh pytorch kind of caught up but tensorflow is still more popular but is it so now in this video i'm gonna give you uh an overview of this two uh frameworks along uh two dimensions so the first one being at the general ease of development how quickly can you prototype something how quickly can you do research and the second dimension is can you deploy it how easy is to deploy your models once you train them and push them to production now what this video is not it's not me telling you go use tensorflow or go use pi torch because neither google nor facebook is paying me to do this video so what this video is it's my review uh based on my research i've done uh on this topic after this video you'll know which framework makes more sense depending on your particular context so unfortunately tensorflow's got this nasty history with static graphs and that was the tensorflow version 1.0 where you basically had to define a steady graph of your neural network before you start using it and it was very hard to debug it was not pythonic and they are paying the price now because of that in the meanwhile uh tensorflow uh released uh tensorflow 2.0 where they basically pretty much copied the uh paradigm pi torque is using and that's dynamic graphs where you basically create the graph of your neural network like you'd write a simple python program so i said nasty because now they have problems with legacy docs is this 1.0 or 2.0 if you go and search your question on stack overflow you'll sometimes get answer from version 1.0 which totally does not make sense for tensorflow 2.0 so 2.0 is also referred to as eager execution and although it did brought dynamic graphs with it it's way slower than pi torch is and that's the second bad thing looking at the api itself now in 2020 they pretty much have the same apis they've converged even uh the one of the co-authors of pytorch said himself in this tweet that it doesn't make any sense to compare them anymore because they've converged so much in that sense fire torch on the other hand was pythonic from the very start it's super easy to learn it's got awesome documentation it's got awesome community and there is no ambiguity between which version is it can i use this one can i use this one it's simple so let's look at some curves uh i don't want this to be me ranting about fire terps is much better in research let's back this up with some numbers okay so there is this awesome website which i'll link in the description uh which is showing us the like relative popularity between tensorflow and pytorch and if we look at the first graph here you can see everything uh above fifty percent means that uh pytorch is uh better so looking at the most famous conferences on computer vision like cvpr or a natural language processing like em nlp or some more classic deep learning machine learning conferences like nips and i see lr pi torch is pretty much beating tensorflow if we look at some autographs like the percentage of papers written in certain framework we can see that cvpr like we 30 of the papers were written in in pythort whereas uh only 7.7 uh of the papers were written in tensorflow and we can see that the number is going down whereas the python trend is not slowing down at all uh finally the last plot just shows us the like the sheer number of papers written in certain framework and cvpr again uh had 418 papers written in pie torch whereas only 113 papers were written in tensorflow and again the trends priority is going up tensorflow is going down it's pretty obvious that pi torque is killing it in the research community now let's take a look at the second dimension uh deploy the dam model to production dimension now tensorflow is much more mature along this dimension so you have so first it's backed up by google secondly simply had more time to mature uh one year to be precise so it's got tensorflow serving so it's a broad term for let's say you you have a web app you have your model served there and basically what it allows you to do is to seamlessly just kind of update the model on the fly without the users ever noticing that happened so it's got a really strong support for that it also has a strong support for uh like deploying your models to mobile devices and also to different kinds of iot devices embedded devices that's known as tensorflow lite again and uh it also has this thing called tensorflow.js which enables you to deploy your models to to the browser pytorch on the other hand has got its own equivalents like pytorch serve and pi torch mobile which do pretty much the same things they are just much less mature than tensorflow uh versions they both came maybe less than a year ago and they still have a long time to just become as mature as tensorflow is in that aspect on the good note many companies like openai are embracing pytorch as their official framework of choice which is really reassuring uh also tesla is using pytorch heavily and andrei karpathy is being promoting pytorch all over the place microsoft officially became the pi torch maintainer for windows platform even big companies are starting to use pi torque which is a cool thing because they obviously have to deploy their models uh and that means they are betting that pi torch will eventually uh mature in that sense as a general conclusion if you're a startup a business and you wanna a cheaper product that has some machine learning deep learning components in it it's probably a safer bet to go with tensorflow as it's got a really mature ecosystem of uh deploying your models on the other hand if you are willing to bet that pi torch will get there eventually and you just want to have the ease of development and to be able to use the the best research out there i'd go with pytorch so for any one of you who doesn't have its own business you just want to learn deep learning i strongly suggest you start with pytorch as a final note it's worth mentioning that uh fast ai is teaching its deep learning courses in pytorch and stanford also started uh teaching its courses in pytorch which will in my opinion buy us new graduates and new phd students to love the framework and to start developing their own startups using pytorch uh which will actually put the inertia movement on pythorg site which was uh till now on tensorflow's site so hope you liked this video and found it useful i'd love to know what's your favorite framework and why and just comment down in the comment section and i'd love to hear your opinions on this one also subscribe to this channel and gently click that bell icon so that you get notified when i upload a new video until next time keep learning you

Original Description

❤️ Become The AI Epiphany Patreon ❤️ ► https://www.patreon.com/theaiepiphany ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ Should you pick PyTorch or TensorFlow? You'll learn: ✔️ A brief history of both frameworks ✔️ How they compare in the research community ✔️ How they compare in shipping to production ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ ✅ TF vs PT papers: http://horace.io/pytorch-vs-tensorflow/ ✅ Google Trends: https://trends.google.com/trends/ ✅ TF GitHub: https://github.com/tensorflow/tensorflow ✅ PT GitHub: https://github.com/pytorch/pytorch ✅ OpenAI blog: https://openai.com/blog/openai-pytorch/ ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ ⌚️ Timetable: 0:00 - Are there any other frameworks? 0:30 - Google Trends (PyTorch vs TensorFlow) 2:27 - Dimension 1: Ease of development & research 4:22 - Data-driven conclusions 5:55 - Dimension 2: Can we ship it? 7:12 - PyTorch is catching up? 7:45 - So what should I use? ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ 💰 BECOME A PATREON OF THE AI EPIPHANY ❤️ If these videos, GitHub projects, and blogs help you, consider helping me out by supporting me on Patreon! The AI Epiphany ► https://www.patreon.com/theaiepiphany One-time donation: https://www.paypal.com/paypalme/theaiepiphany Much love! ❤️ ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ 💡 The AI Epiphany is a channel dedicated to simplifying the field of AI using creative visualizations and in general, a stronger focus on geometrical and visual intuition, rather than the algebraic and numerical "intuition". ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ 👋 CONNECT WITH ME ON SOCIAL LinkedIn ► https://www.linkedin.com/in/aleksagordic/ Twitter ► https://twitter.com/gordic_aleksa Instagram ► https://www.instagram.com/aiepiphany/ Facebook ► https://www.facebook.com/aiepiphany/ 📄 Website - https://gordicaleksa.com/ 👨‍👩‍👧‍👦 JOIN OUR DISCORD COMMUNITY: Discord ► https://discord.gg/peBrCpheKE 📢 SUBSCRIBE TO MY MONTHLY AI NEWSLETTER: Substack ► https://aiepiphany.substack.com/ 💻 FOLLOW ME ON GITHUB FOR COOL PROJECTS: GitHub ► https://github.com/gordic
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Aleksa Gordić - The AI Epiphany · Aleksa Gordić - The AI Epiphany · 14 of 60

1 Intro | Neural Style Transfer #1
Intro | Neural Style Transfer #1
Aleksa Gordić - The AI Epiphany
2 Basic Theory | Neural Style Transfer #2
Basic Theory | Neural Style Transfer #2
Aleksa Gordić - The AI Epiphany
3 Optimization method | Neural Style Transfer #3
Optimization method | Neural Style Transfer #3
Aleksa Gordić - The AI Epiphany
4 Advanced Theory | Neural Style Transfer #4
Advanced Theory | Neural Style Transfer #4
Aleksa Gordić - The AI Epiphany
5 Anyone can make deepfakes now!
Anyone can make deepfakes now!
Aleksa Gordić - The AI Epiphany
6 What is Computer Vision? | The Art of Creating Seeing Machines
What is Computer Vision? | The Art of Creating Seeing Machines
Aleksa Gordić - The AI Epiphany
7 Feed-forward method | Neural Style Transfer #5
Feed-forward method | Neural Style Transfer #5
Aleksa Gordić - The AI Epiphany
8 Alan Turing | Computing Machinery and Intelligence
Alan Turing | Computing Machinery and Intelligence
Aleksa Gordić - The AI Epiphany
9 Feed-forward method (training) | Neural Style Transfer #6
Feed-forward method (training) | Neural Style Transfer #6
Aleksa Gordić - The AI Epiphany
10 What is Google Deep Dream? (Basic Theory) | Deep Dream Series #1
What is Google Deep Dream? (Basic Theory) | Deep Dream Series #1
Aleksa Gordić - The AI Epiphany
11 Semantic Segmentation in PyTorch | Neural Style Transfer #7
Semantic Segmentation in PyTorch | Neural Style Transfer #7
Aleksa Gordić - The AI Epiphany
12 How to get started with Machine Learning
How to get started with Machine Learning
Aleksa Gordić - The AI Epiphany
13 How to learn PyTorch? (3 easy steps) | 2021
How to learn PyTorch? (3 easy steps) | 2021
Aleksa Gordić - The AI Epiphany
PyTorch or TensorFlow?
PyTorch or TensorFlow?
Aleksa Gordić - The AI Epiphany
15 3 Machine Learning Projects For Beginners (Highly visual) | 2021
3 Machine Learning Projects For Beginners (Highly visual) | 2021
Aleksa Gordić - The AI Epiphany
16 Machine Learning Projects (Intermediate level) | 2021
Machine Learning Projects (Intermediate level) | 2021
Aleksa Gordić - The AI Epiphany
17 Cheapest (0$) Deep Learning Hardware Options | 2021
Cheapest (0$) Deep Learning Hardware Options | 2021
Aleksa Gordić - The AI Epiphany
18 How to learn deep learning? (Transformers Example)
How to learn deep learning? (Transformers Example)
Aleksa Gordić - The AI Epiphany
19 How do transformers work? (Attention is all you need)
How do transformers work? (Attention is all you need)
Aleksa Gordić - The AI Epiphany
20 Developing a deep learning project (case study on transformer)
Developing a deep learning project (case study on transformer)
Aleksa Gordić - The AI Epiphany
21 Vision Transformer (ViT) - An image is worth 16x16 words | Paper Explained
Vision Transformer (ViT) - An image is worth 16x16 words | Paper Explained
Aleksa Gordić - The AI Epiphany
22 GPT-3 - Language Models are Few-Shot Learners | Paper Explained
GPT-3 - Language Models are Few-Shot Learners | Paper Explained
Aleksa Gordić - The AI Epiphany
23 Google DeepMind's AlphaFold 2 explained! (Protein folding, AlphaFold 1, a glimpse into AlphaFold 2)
Google DeepMind's AlphaFold 2 explained! (Protein folding, AlphaFold 1, a glimpse into AlphaFold 2)
Aleksa Gordić - The AI Epiphany
24 Attention Is All You Need (Transformer) | Paper Explained
Attention Is All You Need (Transformer) | Paper Explained
Aleksa Gordić - The AI Epiphany
25 Graph Attention Networks (GAT) | GNN Paper Explained
Graph Attention Networks (GAT) | GNN Paper Explained
Aleksa Gordić - The AI Epiphany
26 Graph Convolutional Networks (GCN) | GNN Paper Explained
Graph Convolutional Networks (GCN) | GNN Paper Explained
Aleksa Gordić - The AI Epiphany
27 Graph SAGE - Inductive Representation Learning on Large Graphs | GNN Paper Explained
Graph SAGE - Inductive Representation Learning on Large Graphs | GNN Paper Explained
Aleksa Gordić - The AI Epiphany
28 PinSage - Graph Convolutional Neural Networks for Web-Scale Recommender Systems | Paper Explained
PinSage - Graph Convolutional Neural Networks for Web-Scale Recommender Systems | Paper Explained
Aleksa Gordić - The AI Epiphany
29 OpenAI CLIP - Connecting Text and Images | Paper Explained
OpenAI CLIP - Connecting Text and Images | Paper Explained
Aleksa Gordić - The AI Epiphany
30 Temporal Graph Networks (TGN) | GNN Paper Explained
Temporal Graph Networks (TGN) | GNN Paper Explained
Aleksa Gordić - The AI Epiphany
31 Graph Neural Network Project Update! (I'm coding GAT from scratch)
Graph Neural Network Project Update! (I'm coding GAT from scratch)
Aleksa Gordić - The AI Epiphany
32 Graph Attention Network Project Walkthrough
Graph Attention Network Project Walkthrough
Aleksa Gordić - The AI Epiphany
33 How to get started with Graph ML? (Blog walkthrough)
How to get started with Graph ML? (Blog walkthrough)
Aleksa Gordić - The AI Epiphany
34 DQN - Playing Atari with Deep Reinforcement Learning | RL Paper Explained
DQN - Playing Atari with Deep Reinforcement Learning | RL Paper Explained
Aleksa Gordić - The AI Epiphany
35 AlphaGo - Mastering the game of Go with deep neural networks and tree search | RL Paper Explained
AlphaGo - Mastering the game of Go with deep neural networks and tree search | RL Paper Explained
Aleksa Gordić - The AI Epiphany
36 DeepMind's AlphaGo Zero and AlphaZero | RL paper explained
DeepMind's AlphaGo Zero and AlphaZero | RL paper explained
Aleksa Gordić - The AI Epiphany
37 OpenAI - Solving Rubik's Cube with a Robot Hand | RL paper explained
OpenAI - Solving Rubik's Cube with a Robot Hand | RL paper explained
Aleksa Gordić - The AI Epiphany
38 MuZero - Mastering Atari, Go, Chess and Shogi by Planning with a Learned Model | RL Paper explained
MuZero - Mastering Atari, Go, Chess and Shogi by Planning with a Learned Model | RL Paper explained
Aleksa Gordić - The AI Epiphany
39 EfficientNetV2 - Smaller Models and Faster Training | Paper explained
EfficientNetV2 - Smaller Models and Faster Training | Paper explained
Aleksa Gordić - The AI Epiphany
40 Implementing DeepMind's DQN from scratch! | Project Update
Implementing DeepMind's DQN from scratch! | Project Update
Aleksa Gordić - The AI Epiphany
41 MLP-Mixer: An all-MLP Architecture for Vision | Paper explained
MLP-Mixer: An all-MLP Architecture for Vision | Paper explained
Aleksa Gordić - The AI Epiphany
42 DeepMind's Android RL Environment - AndroidEnv
DeepMind's Android RL Environment - AndroidEnv
Aleksa Gordić - The AI Epiphany
43 When Vision Transformers Outperform ResNets without Pretraining | Paper Explained
When Vision Transformers Outperform ResNets without Pretraining | Paper Explained
Aleksa Gordić - The AI Epiphany
44 Non-Parametric Transformers | Paper explained
Non-Parametric Transformers | Paper explained
Aleksa Gordić - The AI Epiphany
45 Chip Placement with Deep Reinforcement Learning | Paper Explained
Chip Placement with Deep Reinforcement Learning | Paper Explained
Aleksa Gordić - The AI Epiphany
46 Text Style Brush - Transfer of text aesthetics from a single example | Paper Explained
Text Style Brush - Transfer of text aesthetics from a single example | Paper Explained
Aleksa Gordić - The AI Epiphany
47 Graphormer - Do Transformers Really Perform Bad for Graph Representation? | Paper Explained
Graphormer - Do Transformers Really Perform Bad for Graph Representation? | Paper Explained
Aleksa Gordić - The AI Epiphany
48 GANs N' Roses: Stable, Controllable, Diverse Image to Image Translation | Paper Explained
GANs N' Roses: Stable, Controllable, Diverse Image to Image Translation | Paper Explained
Aleksa Gordić - The AI Epiphany
49 VQ-VAEs: Neural Discrete Representation Learning | Paper + PyTorch Code Explained
VQ-VAEs: Neural Discrete Representation Learning | Paper + PyTorch Code Explained
Aleksa Gordić - The AI Epiphany
50 VQ-GAN: Taming Transformers for High-Resolution Image Synthesis | Paper Explained
VQ-GAN: Taming Transformers for High-Resolution Image Synthesis | Paper Explained
Aleksa Gordić - The AI Epiphany
51 Multimodal Few-Shot Learning with Frozen Language Models | Paper Explained
Multimodal Few-Shot Learning with Frozen Language Models | Paper Explained
Aleksa Gordić - The AI Epiphany
52 Focal Transformer: Focal Self-attention for Local-Global Interactions in Vision Transformers
Focal Transformer: Focal Self-attention for Local-Global Interactions in Vision Transformers
Aleksa Gordić - The AI Epiphany
53 AudioCLIP: Extending CLIP to Image, Text and Audio | Paper Explained
AudioCLIP: Extending CLIP to Image, Text and Audio | Paper Explained
Aleksa Gordić - The AI Epiphany
54 RMA: Rapid Motor Adaptation for Legged Robots | Paper Explained
RMA: Rapid Motor Adaptation for Legged Robots | Paper Explained
Aleksa Gordić - The AI Epiphany
55 DALL-E: Zero-Shot Text-to-Image Generation | Paper Explained
DALL-E: Zero-Shot Text-to-Image Generation | Paper Explained
Aleksa Gordić - The AI Epiphany
56 DETR: End-to-End Object Detection with Transformers | Paper Explained
DETR: End-to-End Object Detection with Transformers | Paper Explained
Aleksa Gordić - The AI Epiphany
57 DINO: Emerging Properties in Self-Supervised Vision Transformers | Paper Explained!
DINO: Emerging Properties in Self-Supervised Vision Transformers | Paper Explained!
Aleksa Gordić - The AI Epiphany
58 DeepMind DetCon: Efficient Visual Pretraining with Contrastive Detection | Paper Explained
DeepMind DetCon: Efficient Visual Pretraining with Contrastive Detection | Paper Explained
Aleksa Gordić - The AI Epiphany
59 Do Vision Transformers See Like Convolutional Neural Networks? | Paper Explained
Do Vision Transformers See Like Convolutional Neural Networks? | Paper Explained
Aleksa Gordić - The AI Epiphany
60 Fastformer: Additive Attention Can Be All You Need | Paper Explained
Fastformer: Additive Attention Can Be All You Need | Paper Explained
Aleksa Gordić - The AI Epiphany

This video provides a comparison of PyTorch and TensorFlow, covering their history, research community adoption, and production deployment, to help viewers decide which framework to use. The video highlights the trade-offs between the two frameworks and discusses their respective strengths and weaknesses. By watching this video, viewers can gain a deeper understanding of the two frameworks and make informed decisions about which one to use for their projects.

Key Takeaways
  1. Research the history and development of PyTorch and TensorFlow
  2. Evaluate the trade-offs between the two frameworks
  3. Consider the research community adoption and production deployment of each framework
  4. Assess the strengths and weaknesses of each framework
  5. Make an informed decision about which framework to use for a project
💡 PyTorch is gaining popularity in the research community, while TensorFlow is more mature in deployment, and the choice between the two frameworks depends on the specific needs and goals of a project.

Related Reads

📰
EU tech chief and Tim Cook hold ‘constructive’ talks as Siri AI stays blocked in Europe
EU tech chief and Tim Cook discuss Siri AI blockade in Europe, describing talks as 'constructive'
The Next Web AI
📰
Claude Sonnet 5 Didn’t Just Get Smarter. It Changed the Economics of AI.
Learn how Claude Sonnet 5's advancements changed the economics of AI, making 'good enough AI' viable for production, and understand the implications for AI development and deployment
Medium · AI
📰
Claude Sonnet 5 Didn’t Just Get Smarter. It Changed the Economics of AI.
Claude Sonnet 5's improved AI capabilities have transformed the economics of AI, making it more viable for production
Medium · Machine Learning
📰
MGX’s $49 Billion AI Fund Signals Abu Dhabi’s Long-Term Technology Ambitions
Abu Dhabi invests $49 billion in AI fund through MGX, signaling long-term tech ambitions
Medium · AI

Chapters (7)

Are there any other frameworks?
0:30 Google Trends (PyTorch vs TensorFlow)
2:27 Dimension 1: Ease of development & research
4:22 Data-driven conclusions
5:55 Dimension 2: Can we ship it?
7:12 PyTorch is catching up?
7:45 So what should I use?
Up next
Man dies after horror Gold Coast house fire; high-speed Sydney motorway pursuit | 9 News Australia
9 News Australia
Watch →