Deep Learning Frameworks Compared
Skills:
LLM Foundations80%
Key Takeaways
This video compares 5 popular deep learning frameworks, including SciKit Learn, TensorFlow, Theano, Keras, and Caffe, discussing their pros and cons, and providing code samples in TensorFlow and Theano.
Full Transcript
hello world it's SJ in this video we're going to compare the most popular deep learning Frameworks out there right now to see what works best the Deep learning space is exploding with Frameworks right now it's like every single week some major tech company decides to open source their own deep learning library and that's not including the dozens of deep learning Frameworks being released every single week on GitHub by Cowboy developers how many layers you get let's start off with scikit learn scikit was made to provide an easytouse interface for developers to use off the shelf general purpose machine learning algorithms for both supervised and unsupervised learning psyit provides functions that let you apply classic machine learning algorithms like support Vector machines logistic regressions and kous neighbor very easily but the one type of machine learning algorithm it doesn't let you implement is a neural network it doesn't provide GPU support either which is what helps neural networks scale since like 2 months ago pretty much every single general purpose algorithm that pyit learn implemented has since been implemented intenser flow pyit you just got learned there's also Cafe which was basically the first mainstream production grade deep learning library started in 2013 but Cafe isn't very flexible think of a neural network as a computational graph in Cafe each node is considered a layer so if you want new layer types you have to define the full forward backward and gradient updates these layers are building blocks that are unnecessarily big there's an endless list of them that you can pick from in tensorflow each node is considered a tensor operation like Matrix add or Matrix multiply or convolution and a layer can be defined as a composition of those operations so tensorflow's building blocks are smaller which allows for more modularity Cafe also requires a lot of unnecessary verbosity if you want to support both the CPU and the GPU you need to implement extra functions for each and you have to Define your model using a plain text editor that is just ghetto model should be defined programmatically because it's better for modularity between different components also Cafe's main architect now works on the tensorflow team we're all out of Cafe but speaking of modularity let's talk about Kos Kos has been the go-to source to get started with deep learning for a while because it provides a very high level API to build deep learning models Cara sits on top of the other deep learning libraries like theano and tensorflow it uses an objectoriented design so everything is considered an object be that layers models optimizers and all the parameters of a model can be accessed as object properties like model. layers 3 . output will give you the output tensor for the third layer in the model and model. layers 3. weights is a list of symbolic weight tensors this is a cleaner interface as opposed to the functional approach of making layers functions that create weights when being called great documentation it's all Gucci yes I'm bringing that back but because it's so general purpose it lacks on the side of performance Kos has been known to have performance issues when used with a tensorflow backend since it's not really optimized for it but it does work pretty well with the theano backend the two Frameworks that are neck and neck right now and the race to be the best library for both research and Industry are tensorflow and theano theano currently outperforms tensorflow on a single GPU but tensorflow outperforms theano for parallel execution across multiple gpus Theo's got more documentation because it's been around for a while and it's got native Windows support which tensorflow doesn't yet damn it windows in terms of syntax let's just take a look at some code to see some differences we're going to compare two scripts in tensorflow and Theo both do the same thing initialize some phony data and then learn the line of best fit for that data so it can predict future data points let's look at the first step in both tensorflow and Theo we're generating the data pretty much the same way using numpy arrays so there's not really a difference there let's look at the model initialization Parts this is the basic yal MX plus b slope formula in tensorflow it doesn't require any special treatment of the X and Y variables they're just there natively but in theano we have to specifically say that the variables are symbolic inputs to the function the tensorflow syntax of defining the B and variables is cleaner then we Implement our gradient descent function which is what helps us learn we're trying to minimize the mean squared error over time which is what makes our model more accurate as we train the Syntax for defining what we're minimizing is pretty similar then when we look at the actual Optimizer which helps us do that we'll notice a difference in syntax again tensorflow just gives you access to a bunch of optimizers right out of the box things like radiant descent or atom theano makes you do this from scratch then we have our training function which is again more verbose see the trend here theano so far is making us Implement more code than tensorflow so it seems to give us more fine grain control but at the cost of readability finally we'll get to the actual training part itself they look pretty identical but tensor flow's methodology of encapsulating the computational graph feels conceptually cleaner than theano's tensorflow is just growing so fast that it seems inevitable that whatever feature it lacks right now because of how new it is it will gain very rapidly I mean just look at the amount of activity happening in the tensorflow repo versus the Theo repo on GitHub right now and while Kos serves as an easyuse wrapper around different liaries it's not optimized for tensorflow a better alternative if you want to learn and get started easily with deep learning is TF learn which is basically Kos but optimized for tensorflow so to sum things up the best library to use for research is tensorflow the world-class researchers at both open Ai and Deep Mind are now using it for production the best library to use is still tensorflow since it scales better across multiple gpus than its closest competitor theano lastly for learning the best library to use is tflearn which is a highle rapper around tensorflow that lets you get started really easily also shout out to Rahul Dio for being able to generate an upbeat midi file badass of the week please subscribe for more programming videos for now I've got to go worship tensorflow some more so thanks for watching
Original Description
In this video, I compare 5 of the most popular deep learning frameworks (SciKit Learn, TensorFlow, Theano, Keras, and Caffe). We go through the pros and cons of each, as well as some code samples, eventually coming to a definitive conclusion.
The code for the TensorFlow vs Theano part of the video is here:
https://github.com/llSourcell/tensorflow_vs_theano
An article that explains the differences in more detail:
https://medium.com/@sentimentron/faceoff-theano-vs-tensorflow-e25648c31800#.bg4xmz1au
I created a Slack channel for us, sign up here:
https://wizards.herokuapp.com/
Learn more about TF Learn here:
https://github.com/tflearn/tflearn
and here:
https://www.tensorflow.org/versions/r0.9/tutorials/tflearn/index.html
Learn more about TensorFlow here:
https://www.oreilly.com/learning/hello-tensorflow
More on Keras here:
http://machinelearningmastery.com/tutorial-first-neural-network-python-keras/
More on SciKit Learn here:
http://scikit-learn.org/stable/tutorial/
More on Caffe here:
http://christopher5106.github.io/deep/learning/2015/09/04/Deep-learning-tutorial-on-Caffe-Technology.html
More on Theano here:
https://github.com/Newmu/Theano-Tutorials
Thanks for watching guys, I do this for you. If you like my videos, feel free to support me on Patreon and please LIKE, SUBSCRIBE, COMMENT, AND SHARE!
https://www.patreon.com/user?u=3191693
Follow me:
Twitter: https://twitter.com/sirajraval
Facebook: https://www.facebook.com/sirajology Instagram: https://www.instagram.com/sirajraval/ Instagram: https://www.instagram.com/sirajraval/
Signup for my newsletter for exciting updates in the field of AI:
https://goo.gl/FZzJ5w
Hit the Join button above to sign up to become a member of my channel for access to exclusive content! Join my AI community: http://chatgptschool.io/ Sign up for my AI Sports betting Bot, WagerGPT! (500 spots available): https://www.wagergpt.xyz
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from Siraj Raval · Siraj Raval · 38 of 60
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
▶
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
What is Bitcoin?
Siraj Raval
5 Ways to Use Bitcoin
Siraj Raval
BTC Fever - Siraj [Music Video]
Siraj Raval
5 Reasons to Build Decentralized Apps
Siraj Raval
The Interplanetary File System
Siraj Raval
How to Build a Dapp in 3 min
Siraj Raval
Life Before Smartphones
Siraj Raval
4 Ways to Use Smart Contracts
Siraj Raval
3 Dapps You HAVE to See
Siraj Raval
Char's Life as a BitTorrent Engineer
Siraj Raval
4 Reasons AlphaGo is a Huge Deal
Siraj Raval
Build a Neural Net in 4 Minutes
Siraj Raval
Sentiment Analysis in 4 Minutes
Siraj Raval
The Hackathon Life
Siraj Raval
Your First ML App - Machine Learning for Hackers #1
Siraj Raval
Build an AI Composer - Machine Learning for Hackers #2
Siraj Raval
Build a Game AI - Machine Learning for Hackers #3
Siraj Raval
Build a Movie Recommender - Machine Learning for Hackers #4
Siraj Raval
Build an AI Artist - Machine Learning for Hackers #5
Siraj Raval
Build a Chatbot - ML for Hackers #6
Siraj Raval
Build an AI Reader - Machine Learning for Hackers #7
Siraj Raval
Build an AI Writer - Machine Learning for Hackers #8
Siraj Raval
Build a Chatbot w/ an API - ML for Hackers #9
Siraj Raval
One-Shot Learning - Fresh Machine Learning #1
Siraj Raval
Generative Adversarial Nets - Fresh Machine Learning #2
Siraj Raval
Tone Analysis - Fresh Machine Learning #3
Siraj Raval
Generate Rap Lyrics - Fresh Machine Learning #4
Siraj Raval
Build an Autoencoder in 5 Min - Fresh Machine Learning #5
Siraj Raval
Build a Self Driving Car in 5 Min - Fresh Machine Learning #6
Siraj Raval
Build an Antivirus in 5 Min - Fresh Machine Learning #7
Siraj Raval
TensorFlow in 5 Minutes (tutorial)
Siraj Raval
Build a Recurrent Neural Net in 5 Min
Siraj Raval
Build a Simulation in 5 Min
Siraj Raval
Build a TensorFlow Image Classifier in 5 Min
Siraj Raval
Tensorboard Explained in 5 Min
Siraj Raval
Generate Music in TensorFlow
Siraj Raval
Build a Game Bot (LIVE)
Siraj Raval
Deep Learning Frameworks Compared
Siraj Raval
Introduction - Learn Python for Data Science #1
Siraj Raval
Build a Neural Network (LIVE)
Siraj Raval
Twitter Sentiment Analysis - Learn Python for Data Science #2
Siraj Raval
Recommendation Systems - Learn Python for Data Science #3
Siraj Raval
Predicting Stock Prices - Learn Python for Data Science #4
Siraj Raval
Pong Neural Network (LIVE)
Siraj Raval
Deep Dream in TensorFlow - Learn Python for Data Science #5
Siraj Raval
Visualizing Data with D3.js (LIVE)
Siraj Raval
Genetic Algorithms - Learn Python for Data Science #6
Siraj Raval
Enter Siraj [Music Video]
Siraj Raval
Build a Web Scraper (LIVE)
Siraj Raval
Why is P vs NP Important?
Siraj Raval
How to Make a Neural Network (LIVE)
Siraj Raval
How to Make an Amazing Tensorflow Chatbot Easily
Siraj Raval
How to Make an Amazing Video Game Bot Easily
Siraj Raval
How to Make a Tensorflow Neural Network (LIVE)
Siraj Raval
How to Make a Simple Tensorflow Speech Recognizer
Siraj Raval
Joel Shor - Really Quick Questions with an Awesome Google Engineer
Siraj Raval
How to Make a Path Planning Algorithm Easily (LIVE)
Siraj Raval
The Best Way to Prepare a Dataset Easily
Siraj Raval
Catherine Olsson - Really Quick Questions with an OpenAI Engineer
Siraj Raval
How to Make a Tic Tac Toe Neural Network Easily (LIVE)
Siraj Raval
More on: LLM Foundations
View skill →Related AI Lessons
⚡
⚡
⚡
⚡
Want to get started with deep learning
Reddit r/deeplearning
Building a Deepfake Detector From Scratch — What Nobody Tells You
Medium · Deep Learning
Unfolding the Meandering Path: High-Dimensional Invariance and the Flat 2D Plane of Neural…
Medium · Deep Learning
Implementing Neural Style Transfer from Scratch: The Project That Started It All
Medium · Deep Learning
🎓
Tutor Explanation
DeepCamp AI