SlideShare a Scribd company logo
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Agenda
What is Keras?
Contributors for Keras
Keras Models
Implementing a Neural Network
Use-Case
Summary
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
What Is Keras?
Official high-level API of TensorFlow!
Copyright © 2018, edureka and/or its affiliates. All rights reserved.
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
What Is Keras?
Keras - Modular
• Building models is as simple
as stacking layers and
connecting graphs.
Open Source
• Actively developed by contributors across
the world!
• Good amount of documentation
Deep Learning Library
• High-level Neural Network API
• Runs on top of TensorFlow,
Theano or CNTK.
High Performance
• High performing API used to
specify and train differentiable
programs.
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Who Makes Keras?
Who are the contributors and backers?
Copyright © 2018, edureka and/or its affiliates. All rights reserved.
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Who Makes Keras?
4800+ Contributors
250,000
Keras developers
> 2x
Year-on-year growth
Start-ups
Good amount of traction
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Who Uses Keras?
Let’s check out the industry traction!
Copyright © 2018, edureka and/or its affiliates. All rights reserved.
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Industry Traction
And more..!
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
What Makes Keras Special?
Highlights from one of the top Deep Learning libraries!
Copyright © 2018, edureka and/or its affiliates. All rights reserved.
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
What Makes Keras Special?
Large adoption in the industry
Multi-backend, multi-platform
Focus on user experience
Research community4
Easy to grasp all concepts5
Fast prototyping6
Runs seamlessly on CPU and GPU7
Freedom to design any architecture8
Simple to get started9
Easy production of models10
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Keras User Experience
API Designed for Humans
• Keras follows best practices for
reducing cognitive load
• Offers consistent and simple APIs
Not Designed for Machines
• Minimizes number of user actions required
for common use cases
• Provides clear feedback upon user error
Easy to Learn & Easy to Use
• More productive
• Try more ideas than your competition
• Helps you win competitions
High Flexibility
• Keras integrates with lower-level
Deep Learning languages like
TensorFlow
• Implement anything which was
built in base language.
1
3
2
4
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Multi-Backend & Multi-Platform
01 02 03
Development
Develop in Python, R
Run the code with:
• TensorFlow
• CNTK
• Theano
• MXNet
• CPU
• NVIDIA GPU
• AMD GPU
• TPU
• Etc..
Producing Models
• TF-Serving
• GPU acceleration
(WebKeras, Keras.js)
• Android (TF, TF Lite)
• iOS (Native CoreML)
• Raspberry Pi
{code}
Run The Code
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Working Principle Of Keras
Let’s take a quick look at the basics of Keras’ backend
Copyright © 2018, edureka and/or its affiliates. All rights reserved.
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Working Principle – Backend
• e = c*d where, “c = a+b” and “d = b+1”
• So, e = (a+b)*(b+1)
• Here “a” ,“b” are inputs
01
02
03
04
Expressing complex expressions as a
combination of simple operations
Useful for calculating derivatives
during backpropagation
Easier to implement distributed
computation
Just specify the inputs, outputs and
make sure the graph is connected
Computational Graphs
As easy as that!
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Keras Models
There are 2 major models that Keras offers!
Copyright © 2018, edureka and/or its affiliates. All rights reserved.
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Keras Models
Sequential Model
• Linear stack of layers
• Useful for building simple models
• Simple classification network
• Encoder – Decoder models
• The model we all know and love!
• Treat each layer as object that feeds into the next.
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Keras Models
Functional Model
• Like playing with Lego bricks
• Good for 95% of use cases
Multi-input, multi-output and arbitrary static graph
topologies
Multi – input and Multi – output models
Complex models which forks into 2 or more
branches
Models with shared (Weights) layers
01
02
03
04
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Keras Models
Functional Model (Domain Adaption)
• Train on Domain A and Test on Domain B
• Results in poor performance on test set
• The data are from different domains
We will be looking at a very interesting use case
using the functional model in the upcoming slides
Solution: Adapt the model to both the domains
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Understanding Execution
There are 2 types of execution!
Copyright © 2018, edureka and/or its affiliates. All rights reserved.
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Execution – Two Types
Deferred (symbolic)
• We use Python to build a
computation graph first
• The compiled graph then
gets executed later
Eager ( imperative)
• Here, the Python runtime
is the execution runtime
• It is similar to execution
with Numpy
• Symbolic tensors don’t have a value in the Python code (yet)
• Eager tensors have a value in the Python code
• With eager execution, value-dependent dynamic topologies
(tree-RNNs) can be used.
On the whole
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Implementing a Neural Network
There are 5 major steps to implement our own Neural Network with Keras!
Copyright © 2018, edureka and/or its affiliates. All rights reserved.
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Implementing A Neural Network
1. Prepare Input
• Preparing the input and
specify the input dimension
(size)
• Images, videos, text and audio
2. Define the ANN Model
• Define the model architecture and
build the computational graph
• Sequential or Functional Style
• MLP, CNN, RNN 3. Optimizers
• Specify the optimizer and configure
the learning process
• SGD, RMSprop, Adam
5. Train and Evaluate Model
• Train the model based on the
training data
• Test the model on the dataset
with the testing data
4. Loss Function
• Specify the Inputs, Outputs of the
computational graph (model) and
the Loss function
• MSE, Cross Entropy, Hinge
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Use-Case With Keras
Let’s check out an interesting Wine Classifier use-case!
Copyright © 2018, edureka and/or its affiliates. All rights reserved.
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Use Case – Problem Statement
“Predicting the price of wine with the Keras Functional API and TensorFlow”
Building a wide and deep network using Keras (tf.Keras)
to predict the price of wine from its description
Predict the price of a bottle of wine
just from its description and variety?
• This problem is well suited for wide & deep learning
• It involves text input and there isn’t any correlation
between a wine’s description and its price
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Use Case – Model
A good use-case for the Functional API is implementing a
wide and deep network in Keras!
A lot of Keras models are built using the Sequential model API
BUT Let’s try to solve our use-case with the Functional API
The Sequential API is the best way to get started with Keras
Because it lets you easily define models as a stack of layers
The Functional API allows for more flexibility and is best
suited for models with multiple inputs or combined models
Wide models are models with
sparse feature vectors or
vectors with mostly zero values
Multi-layer deep networks
do well on tasks like image
or speech recognition
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Use Case – Dataset
DATASET
Country1
2 Description
3 Designation
4 Points
5 Price
6 Region_1
Region_27
8 Taster Name
9
Taster Twitter
Handle
10 Title
Variety11
Winery12
The overall goal is to create a model that
can identify the variety, winery and
location of a wine based on a description
This dataset offers some great
opportunities for sentiment analysis
and other text related predictive models
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Use Case – Sample
Description:
• Powerful vanilla scents rise from the glass, but the fruit, even in this difficult vintage, comes out
immediately.
• It’s tart and sharp, with a strong herbal component, and the wine snaps into focus quickly with fruit, acid,
tannin, herb and vanilla in equal proportion.
• Firm and tight, still quite young, this wine needs decanting and/or further bottle age to show its best.
Variety: Pinot Noir
Prediction:
Price — $45
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Use Case – Prerequisites
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Use Case – Prerequisites
Here are all the imports we’ll need to build this model!
Test presence of TensorFlow by printing the version
Download the data and convert it to a Pandas Data Frame
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Use Case – Let’s See Code!
Google Colaboratory
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Session In A Minute
What is Keras? Contributors Specialty of Keras
Implementing a Neural Network Use-Case ImplementationKeras Models
Copyright © 2018, edureka and/or its affiliates. All rights reserved.
Keras Tutorial For Beginners | Creating Deep Learning Models Using Keras In Python | Edureka

More Related Content

What's hot (20)

PDF
Introduction To TensorFlow
Spotle.ai
 
PPTX
Introduction to Keras
John Ramey
 
PPTX
What is TensorFlow? | Introduction to TensorFlow | TensorFlow Tutorial For Be...
Simplilearn
 
PDF
TensorFlow and Keras: An Overview
Poo Kuan Hoong
 
PPTX
Deep learning with keras
MOHITKUMAR1379
 
PDF
Introduction to keras
Haritha Thilakarathne
 
PDF
SVM Algorithm Explained | Support Vector Machine Tutorial Using R | Edureka
Edureka!
 
PDF
Introduction to TensorFlow 2.0
Databricks
 
PPTX
Machine learning
Saurabh Agrawal
 
PPTX
TensorFlow Tutorial | Deep Learning With TensorFlow | TensorFlow Tutorial For...
Simplilearn
 
PDF
Deep learning - A Visual Introduction
Lukas Masuch
 
PPTX
KERAS Python Tutorial
MahmutKAMALAK
 
PDF
Tensorflow presentation
Ahmed rebai
 
PPTX
Introduction to Machine Learning
Rahul Jain
 
PPTX
Machine Learning on Your Hand - Introduction to Tensorflow Lite Preview
Modulabs
 
PDF
PyTorch Introduction
Yash Kawdiya
 
PDF
Machine Learning with TensorFlow 2
Sarah Stemmler
 
PDF
How Netflix uses Python? Edureka
Edureka!
 
PPT
Machine Learning
Vivek Garg
 
PPTX
Data Science With Python | Python For Data Science | Python Data Science Cour...
Simplilearn
 
Introduction To TensorFlow
Spotle.ai
 
Introduction to Keras
John Ramey
 
What is TensorFlow? | Introduction to TensorFlow | TensorFlow Tutorial For Be...
Simplilearn
 
TensorFlow and Keras: An Overview
Poo Kuan Hoong
 
Deep learning with keras
MOHITKUMAR1379
 
Introduction to keras
Haritha Thilakarathne
 
SVM Algorithm Explained | Support Vector Machine Tutorial Using R | Edureka
Edureka!
 
Introduction to TensorFlow 2.0
Databricks
 
Machine learning
Saurabh Agrawal
 
TensorFlow Tutorial | Deep Learning With TensorFlow | TensorFlow Tutorial For...
Simplilearn
 
Deep learning - A Visual Introduction
Lukas Masuch
 
KERAS Python Tutorial
MahmutKAMALAK
 
Tensorflow presentation
Ahmed rebai
 
Introduction to Machine Learning
Rahul Jain
 
Machine Learning on Your Hand - Introduction to Tensorflow Lite Preview
Modulabs
 
PyTorch Introduction
Yash Kawdiya
 
Machine Learning with TensorFlow 2
Sarah Stemmler
 
How Netflix uses Python? Edureka
Edureka!
 
Machine Learning
Vivek Garg
 
Data Science With Python | Python For Data Science | Python Data Science Cour...
Simplilearn
 

Similar to Keras Tutorial For Beginners | Creating Deep Learning Models Using Keras In Python | Edureka (20)

PDF
CI-Keras for deep learning by adrian.pdf
sakshamagarwalm2
 
PDF
Top 8 Deep Learning Frameworks | Which Deep Learning Framework You Should Lea...
Edureka!
 
PDF
TensorFlow meetup: Keras - Pytorch - TensorFlow.js
Stijn Decubber
 
PDF
Deep Domain
Zachary S. Brown
 
PPTX
Amazon Deep Learning
Amanda Mackay (she/her)
 
PDF
Leveraging NLP and Deep Learning for Document Recommendations in the Cloud
Databricks
 
PDF
Austin,TX Meetup presentation tensorflow final oct 26 2017
Clarisse Hedglin
 
PPTX
Deep Learning on Qubole Data Platform
Shivaji Dutta
 
PDF
Scalable Deep Learning Platform On Spark In Baidu
Jen Aman
 
PPTX
Paddle_Spark_Summit
Min Hsieh (Kyle) Tsai
 
PDF
Data Con LA 2018 - A Tale of DL Frameworks: TensorFlow, Keras, & Deep Learnin...
Data Con LA
 
PDF
A Tale of Three Deep Learning Frameworks: TensorFlow, Keras, & Deep Learning ...
Databricks
 
PDF
A Tale of Three Deep Learning Frameworks: TensorFlow, Keras, and Deep Learnin...
Databricks
 
PDF
NLP and Deep Learning for non_experts
Sanghamitra Deb
 
PDF
PyTorch vs TensorFlow: The Force Is Strong With Which One? | Which One You Sh...
Edureka!
 
PPTX
Introduction to Designing and Building Big Data Applications
Cloudera, Inc.
 
PDF
NoSQL and SQL - Why Choose? Enjoy the best of both worlds with MySQL
Andrew Morgan
 
PPTX
No BS Guide to Deep Learning in the Enterprise
Jesus Rodriguez
 
PPTX
IBM Developer Model Asset eXchange
Nick Pentreath
 
PPTX
IBM Developer Model Asset eXchange - Deep Learning for Everyone
Nick Pentreath
 
CI-Keras for deep learning by adrian.pdf
sakshamagarwalm2
 
Top 8 Deep Learning Frameworks | Which Deep Learning Framework You Should Lea...
Edureka!
 
TensorFlow meetup: Keras - Pytorch - TensorFlow.js
Stijn Decubber
 
Deep Domain
Zachary S. Brown
 
Amazon Deep Learning
Amanda Mackay (she/her)
 
Leveraging NLP and Deep Learning for Document Recommendations in the Cloud
Databricks
 
Austin,TX Meetup presentation tensorflow final oct 26 2017
Clarisse Hedglin
 
Deep Learning on Qubole Data Platform
Shivaji Dutta
 
Scalable Deep Learning Platform On Spark In Baidu
Jen Aman
 
Paddle_Spark_Summit
Min Hsieh (Kyle) Tsai
 
Data Con LA 2018 - A Tale of DL Frameworks: TensorFlow, Keras, & Deep Learnin...
Data Con LA
 
A Tale of Three Deep Learning Frameworks: TensorFlow, Keras, & Deep Learning ...
Databricks
 
A Tale of Three Deep Learning Frameworks: TensorFlow, Keras, and Deep Learnin...
Databricks
 
NLP and Deep Learning for non_experts
Sanghamitra Deb
 
PyTorch vs TensorFlow: The Force Is Strong With Which One? | Which One You Sh...
Edureka!
 
Introduction to Designing and Building Big Data Applications
Cloudera, Inc.
 
NoSQL and SQL - Why Choose? Enjoy the best of both worlds with MySQL
Andrew Morgan
 
No BS Guide to Deep Learning in the Enterprise
Jesus Rodriguez
 
IBM Developer Model Asset eXchange
Nick Pentreath
 
IBM Developer Model Asset eXchange - Deep Learning for Everyone
Nick Pentreath
 
Ad

More from Edureka! (20)

PDF
What to learn during the 21 days Lockdown | Edureka
Edureka!
 
PDF
Top 10 Dying Programming Languages in 2020 | Edureka
Edureka!
 
PDF
Top 5 Trending Business Intelligence Tools | Edureka
Edureka!
 
PDF
Tableau Tutorial for Data Science | Edureka
Edureka!
 
PDF
Python Programming Tutorial | Edureka
Edureka!
 
PDF
Top 5 PMP Certifications | Edureka
Edureka!
 
PDF
Top Maven Interview Questions in 2020 | Edureka
Edureka!
 
PDF
Linux Mint Tutorial | Edureka
Edureka!
 
PDF
How to Deploy Java Web App in AWS| Edureka
Edureka!
 
PDF
Importance of Digital Marketing | Edureka
Edureka!
 
PDF
RPA in 2020 | Edureka
Edureka!
 
PDF
Email Notifications in Jenkins | Edureka
Edureka!
 
PDF
EA Algorithm in Machine Learning | Edureka
Edureka!
 
PDF
Cognitive AI Tutorial | Edureka
Edureka!
 
PDF
AWS Cloud Practitioner Tutorial | Edureka
Edureka!
 
PDF
Blue Prism Top Interview Questions | Edureka
Edureka!
 
PDF
Big Data on AWS Tutorial | Edureka
Edureka!
 
PDF
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
Edureka!
 
PDF
Kubernetes Installation on Ubuntu | Edureka
Edureka!
 
PDF
Introduction to DevOps | Edureka
Edureka!
 
What to learn during the 21 days Lockdown | Edureka
Edureka!
 
Top 10 Dying Programming Languages in 2020 | Edureka
Edureka!
 
Top 5 Trending Business Intelligence Tools | Edureka
Edureka!
 
Tableau Tutorial for Data Science | Edureka
Edureka!
 
Python Programming Tutorial | Edureka
Edureka!
 
Top 5 PMP Certifications | Edureka
Edureka!
 
Top Maven Interview Questions in 2020 | Edureka
Edureka!
 
Linux Mint Tutorial | Edureka
Edureka!
 
How to Deploy Java Web App in AWS| Edureka
Edureka!
 
Importance of Digital Marketing | Edureka
Edureka!
 
RPA in 2020 | Edureka
Edureka!
 
Email Notifications in Jenkins | Edureka
Edureka!
 
EA Algorithm in Machine Learning | Edureka
Edureka!
 
Cognitive AI Tutorial | Edureka
Edureka!
 
AWS Cloud Practitioner Tutorial | Edureka
Edureka!
 
Blue Prism Top Interview Questions | Edureka
Edureka!
 
Big Data on AWS Tutorial | Edureka
Edureka!
 
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
Edureka!
 
Kubernetes Installation on Ubuntu | Edureka
Edureka!
 
Introduction to DevOps | Edureka
Edureka!
 
Ad

Recently uploaded (20)

PDF
ArcGIS Utility Network Migration - The Hunter Water Story
Safe Software
 
PDF
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
yosra Saidani
 
PDF
FME as an Orchestration Tool with Principles From Data Gravity
Safe Software
 
PDF
Plugging AI into everything: Model Context Protocol Simplified.pdf
Abati Adewale
 
PDF
Unlocking FME Flow’s Potential: Architecture Design for Modern Enterprises
Safe Software
 
PDF
UiPath Agentic AI ile Akıllı Otomasyonun Yeni Çağı
UiPathCommunity
 
PPTX
𝙳𝚘𝚠𝚗𝚕𝚘𝚊𝚍—Wondershare Filmora Crack 14.0.7 + Key Download 2025
sebastian aliya
 
PPSX
Usergroup - OutSystems Architecture.ppsx
Kurt Vandevelde
 
PDF
The Growing Value and Application of FME & GenAI
Safe Software
 
PDF
Java 25 and Beyond - A Roadmap of Innovations
Ana-Maria Mihalceanu
 
PDF
Redefining Work in the Age of AI - What to expect? How to prepare? Why it mat...
Malinda Kapuruge
 
PDF
The Future of Product Management in AI ERA.pdf
Alyona Owens
 
DOCX
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
 
PDF
Why aren't you using FME Flow's CPU Time?
Safe Software
 
PDF
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Priyanka Aash
 
PDF
Enhancing Environmental Monitoring with Real-Time Data Integration: Leveragin...
Safe Software
 
PDF
5 Things to Consider When Deploying AI in Your Enterprise
Safe Software
 
PDF
“MPU+: A Transformative Solution for Next-Gen AI at the Edge,” a Presentation...
Edge AI and Vision Alliance
 
PDF
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
Earley Information Science
 
PPTX
Practical Applications of AI in Local Government
OnBoard
 
ArcGIS Utility Network Migration - The Hunter Water Story
Safe Software
 
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
yosra Saidani
 
FME as an Orchestration Tool with Principles From Data Gravity
Safe Software
 
Plugging AI into everything: Model Context Protocol Simplified.pdf
Abati Adewale
 
Unlocking FME Flow’s Potential: Architecture Design for Modern Enterprises
Safe Software
 
UiPath Agentic AI ile Akıllı Otomasyonun Yeni Çağı
UiPathCommunity
 
𝙳𝚘𝚠𝚗𝚕𝚘𝚊𝚍—Wondershare Filmora Crack 14.0.7 + Key Download 2025
sebastian aliya
 
Usergroup - OutSystems Architecture.ppsx
Kurt Vandevelde
 
The Growing Value and Application of FME & GenAI
Safe Software
 
Java 25 and Beyond - A Roadmap of Innovations
Ana-Maria Mihalceanu
 
Redefining Work in the Age of AI - What to expect? How to prepare? Why it mat...
Malinda Kapuruge
 
The Future of Product Management in AI ERA.pdf
Alyona Owens
 
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
 
Why aren't you using FME Flow's CPU Time?
Safe Software
 
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Priyanka Aash
 
Enhancing Environmental Monitoring with Real-Time Data Integration: Leveragin...
Safe Software
 
5 Things to Consider When Deploying AI in Your Enterprise
Safe Software
 
“MPU+: A Transformative Solution for Next-Gen AI at the Edge,” a Presentation...
Edge AI and Vision Alliance
 
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
Earley Information Science
 
Practical Applications of AI in Local Government
OnBoard
 

Keras Tutorial For Beginners | Creating Deep Learning Models Using Keras In Python | Edureka

  • 1. AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
  • 2. AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow Agenda What is Keras? Contributors for Keras Keras Models Implementing a Neural Network Use-Case Summary
  • 3. Copyright © 2017, edureka and/or its affiliates. All rights reserved. What Is Keras? Official high-level API of TensorFlow! Copyright © 2018, edureka and/or its affiliates. All rights reserved.
  • 4. AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow What Is Keras? Keras - Modular • Building models is as simple as stacking layers and connecting graphs. Open Source • Actively developed by contributors across the world! • Good amount of documentation Deep Learning Library • High-level Neural Network API • Runs on top of TensorFlow, Theano or CNTK. High Performance • High performing API used to specify and train differentiable programs.
  • 5. AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow Who Makes Keras? Who are the contributors and backers? Copyright © 2018, edureka and/or its affiliates. All rights reserved.
  • 6. AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow Who Makes Keras? 4800+ Contributors 250,000 Keras developers > 2x Year-on-year growth Start-ups Good amount of traction
  • 7. AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow Who Uses Keras? Let’s check out the industry traction! Copyright © 2018, edureka and/or its affiliates. All rights reserved.
  • 8. AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow Industry Traction And more..!
  • 9. AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow What Makes Keras Special? Highlights from one of the top Deep Learning libraries! Copyright © 2018, edureka and/or its affiliates. All rights reserved.
  • 10. AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow What Makes Keras Special? Large adoption in the industry Multi-backend, multi-platform Focus on user experience Research community4 Easy to grasp all concepts5 Fast prototyping6 Runs seamlessly on CPU and GPU7 Freedom to design any architecture8 Simple to get started9 Easy production of models10
  • 11. AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow Keras User Experience API Designed for Humans • Keras follows best practices for reducing cognitive load • Offers consistent and simple APIs Not Designed for Machines • Minimizes number of user actions required for common use cases • Provides clear feedback upon user error Easy to Learn & Easy to Use • More productive • Try more ideas than your competition • Helps you win competitions High Flexibility • Keras integrates with lower-level Deep Learning languages like TensorFlow • Implement anything which was built in base language. 1 3 2 4
  • 12. AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow Multi-Backend & Multi-Platform 01 02 03 Development Develop in Python, R Run the code with: • TensorFlow • CNTK • Theano • MXNet • CPU • NVIDIA GPU • AMD GPU • TPU • Etc.. Producing Models • TF-Serving • GPU acceleration (WebKeras, Keras.js) • Android (TF, TF Lite) • iOS (Native CoreML) • Raspberry Pi {code} Run The Code
  • 13. AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow Working Principle Of Keras Let’s take a quick look at the basics of Keras’ backend Copyright © 2018, edureka and/or its affiliates. All rights reserved.
  • 14. AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow Working Principle – Backend • e = c*d where, “c = a+b” and “d = b+1” • So, e = (a+b)*(b+1) • Here “a” ,“b” are inputs 01 02 03 04 Expressing complex expressions as a combination of simple operations Useful for calculating derivatives during backpropagation Easier to implement distributed computation Just specify the inputs, outputs and make sure the graph is connected Computational Graphs As easy as that!
  • 15. AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow Keras Models There are 2 major models that Keras offers! Copyright © 2018, edureka and/or its affiliates. All rights reserved.
  • 16. AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow Keras Models Sequential Model • Linear stack of layers • Useful for building simple models • Simple classification network • Encoder – Decoder models • The model we all know and love! • Treat each layer as object that feeds into the next.
  • 17. AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow Keras Models Functional Model • Like playing with Lego bricks • Good for 95% of use cases Multi-input, multi-output and arbitrary static graph topologies Multi – input and Multi – output models Complex models which forks into 2 or more branches Models with shared (Weights) layers 01 02 03 04
  • 18. AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow Keras Models Functional Model (Domain Adaption) • Train on Domain A and Test on Domain B • Results in poor performance on test set • The data are from different domains We will be looking at a very interesting use case using the functional model in the upcoming slides Solution: Adapt the model to both the domains
  • 19. AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow Understanding Execution There are 2 types of execution! Copyright © 2018, edureka and/or its affiliates. All rights reserved.
  • 20. AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow Execution – Two Types Deferred (symbolic) • We use Python to build a computation graph first • The compiled graph then gets executed later Eager ( imperative) • Here, the Python runtime is the execution runtime • It is similar to execution with Numpy • Symbolic tensors don’t have a value in the Python code (yet) • Eager tensors have a value in the Python code • With eager execution, value-dependent dynamic topologies (tree-RNNs) can be used. On the whole
  • 21. AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow Implementing a Neural Network There are 5 major steps to implement our own Neural Network with Keras! Copyright © 2018, edureka and/or its affiliates. All rights reserved.
  • 22. AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow Implementing A Neural Network 1. Prepare Input • Preparing the input and specify the input dimension (size) • Images, videos, text and audio 2. Define the ANN Model • Define the model architecture and build the computational graph • Sequential or Functional Style • MLP, CNN, RNN 3. Optimizers • Specify the optimizer and configure the learning process • SGD, RMSprop, Adam 5. Train and Evaluate Model • Train the model based on the training data • Test the model on the dataset with the testing data 4. Loss Function • Specify the Inputs, Outputs of the computational graph (model) and the Loss function • MSE, Cross Entropy, Hinge
  • 23. AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow Use-Case With Keras Let’s check out an interesting Wine Classifier use-case! Copyright © 2018, edureka and/or its affiliates. All rights reserved.
  • 24. AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow Use Case – Problem Statement “Predicting the price of wine with the Keras Functional API and TensorFlow” Building a wide and deep network using Keras (tf.Keras) to predict the price of wine from its description Predict the price of a bottle of wine just from its description and variety? • This problem is well suited for wide & deep learning • It involves text input and there isn’t any correlation between a wine’s description and its price
  • 25. AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow Use Case – Model A good use-case for the Functional API is implementing a wide and deep network in Keras! A lot of Keras models are built using the Sequential model API BUT Let’s try to solve our use-case with the Functional API The Sequential API is the best way to get started with Keras Because it lets you easily define models as a stack of layers The Functional API allows for more flexibility and is best suited for models with multiple inputs or combined models Wide models are models with sparse feature vectors or vectors with mostly zero values Multi-layer deep networks do well on tasks like image or speech recognition
  • 26. AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow Use Case – Dataset DATASET Country1 2 Description 3 Designation 4 Points 5 Price 6 Region_1 Region_27 8 Taster Name 9 Taster Twitter Handle 10 Title Variety11 Winery12 The overall goal is to create a model that can identify the variety, winery and location of a wine based on a description This dataset offers some great opportunities for sentiment analysis and other text related predictive models
  • 27. AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow Use Case – Sample Description: • Powerful vanilla scents rise from the glass, but the fruit, even in this difficult vintage, comes out immediately. • It’s tart and sharp, with a strong herbal component, and the wine snaps into focus quickly with fruit, acid, tannin, herb and vanilla in equal proportion. • Firm and tight, still quite young, this wine needs decanting and/or further bottle age to show its best. Variety: Pinot Noir Prediction: Price — $45
  • 28. AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow Use Case – Prerequisites
  • 29. AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow Use Case – Prerequisites Here are all the imports we’ll need to build this model! Test presence of TensorFlow by printing the version Download the data and convert it to a Pandas Data Frame
  • 30. AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow Use Case – Let’s See Code! Google Colaboratory
  • 31. AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow Session In A Minute What is Keras? Contributors Specialty of Keras Implementing a Neural Network Use-Case ImplementationKeras Models
  • 32. Copyright © 2018, edureka and/or its affiliates. All rights reserved.