Agenda
1. Introduction to Basic Terms and how they fit together:
○ AI, Big Data, Machine Learning, Deep Learning,
○ IOT, Neural Networks
2. Brief overview of use case of Deep Learning
3. How to Approach a Deep Learning Problem:
○ How to approach?
○ Which Tools?
○ Which Algorithms?
4. Questions & Answers
Introduction to Deep Learning
About CloudxLab
Videos Quizzes Hands-On Projects Case Studies
Real Life Use Cases
Making learning fun and for life
Automated Hands-on Assessments
Learn by doing
Automated Hands-on Assessments
Problem Statement Hands On Assessment
Automated Hands-on Assessments
Problem
Statement
Evaluation
Automated Hands-on Assessments
Python Assessment Jupyter Notebook
Automated Hands-on Assessments
Python Assessment Jupyter Notebook
Machine Learning
with
Python - Scikit Learn
Course Objective
Course Instructor
Sandeep Giri
Worked On Large Scale Computing
Graduated from IIT Roorkee
Software Engineer
Loves Explaining Technologies
Founder
Machine Learning
What Is Machine Learning?
Field of study that gives "computers the ability to
learn without being explicitly programmed"
-- Arthur Samuel, 1959
Machine Learning
What Is Machine Learning?
Let us understand it with real use case...
Machine Learning
Have You Played Mario?
How much time did it take you to learn & win the princess?
Machine Learning
Have You Played Mario?
Did Anyone teach you?
Machine Learning
How About Automating it?
Machine Learning
How About Automating it?
• Program Learns to Play Mario
Machine Learning
How About Automating it?
• Program Learns to Play Mario
• Observes the game & pressed keys
Machine Learning
How About Automating it?
• Program Learns to Play Mario
• Observes the game & pressed keys
• Maximises Score
Machine Learning
How About Automating it?
Machine Learning
How About Automating it?
● So, the program learnt to play
○ Mario
○ And Other games
○ Without any programming
Machine Learning
Question
To make this program learn any other games such as PacMan we will have to
1. Write new rules as per the game
2. Just hook it to new game and let it play for a while
Machine Learning
Question
To make this program learn any other games such as PacMan we will have to
1. Write new rules as per the game
2. Just hook it to new game and let it play for a while
Machine Learning
Gather data and automatically solve problems
Imagine Doing The Same For Life
Machine Learning
The Machine Learning Tsunami - 1
● Self driving cars on the roads
Machine Learning
The Machine Learning Tsunami - 2
● Netflix movies recommendations
Machine Learning
The Machine Learning Tsunami - 3
● Amazon product recommendations
Machine Learning
The Machine Learning Tsunami - 4
● Accurate results in Google Search
Machine Learning
The Machine Learning Tsunami - 5
● Speech recognition in your smartphone
Machine Learning
Question
What do we need to
● Gather Data
● And automatically solving the problem?
IntelligenceData
+
Machine Learning
Collect Data or Take Actions - IOT
Phone & Devices
Cheaper, faster and smaller
Connectivity
Wifi, 4G, NFC, GPS
Machine Learning
Intelligence - Traditional vs ML.
How you would write a spam filter?
Machine Learning
Intelligence - Spam Filter - Traditional Approach
21
3
Machine Learning
Intelligence - Spam Filter - Traditional Approach
Problems?
Machine Learning
Intelligence - Spam Filter - Traditional Approach
● Problem is not trivial
○ Program will likely become a long list of complex rules
○ Pretty hard to maintain
● If spammers notice that
○ All their emails containing “4U” are blocked
○ They might start writing “For U” instead
○ If spammers keep working around spam filter, we will need to keep writing
new rules forever
Problems?
Machine Learning
Intelligence - Spam Filter - ML Approach
Machine Learning
Intelligence - Spam Filter - ML Approach
● A spam filter based on Machine Learning techniques automatically learns
○ Which words and phrases are good predictors of spam
○ By detecting unusually frequent patterns of words
● The program will be
○ Much shorter
○ Easier to maintain
○ Most likely more accurate than traditional approach
Machine Learning
Intelligence - Spam Filter - ML Approach
● Unlike traditional approach, ML techniques automatically notice that
○ “For U” has become unusually frequent in spam flagged by users and
○ It starts flagging them without our intervention
Machine Learning
Intelligence - Spam Filter - ML Approach
Can help humans learn
● ML algorithms can be inspected to see what they have learned
● Spam filter after enough training
○ Reveals combinations of words that it believes are best predictors of spam
○ May reveal unsuspected correlations or new trend and
○ Lead to a better understanding of the problem for humans
Machine Learning
Intelligence - Spam Filter - ML Approach
Can help humans learn
Machine Learning
What is AI?
Artificial intelligence (AI):
The intelligence exhibited by machines
Machine Learning
What is AI?
• The theory and development of
computer systems
Machine Learning
What is AI?
• The theory and development of
computer systems
• To perform tasks requiring human
intelligence such as
Machine Learning
What is AI?
• The theory and development of
computer systems
• To perform tasks requiring human
intelligence such as
• Visual perception
Machine Learning
What is AI?
• The theory and development of
computer systems
• To perform tasks requiring human
intelligence such as
• Visual perception
• Speech Recognition
Machine Learning
What is AI?
• The theory and development of
computer systems
• To perform tasks requiring human
intelligence such as
• Visual perception
• Speech Recognition
• Decision Making
Machine Learning
What is AI?
• The theory and development of
computer systems
• To perform tasks requiring human
intelligence such as
• Visual perception
• Speech Recognition
• Decision Making
• Translation between languages
Machine Learning
History - Summer of 1956
• The term artificial intelligence was
coined by
• John McCarthy
• In a workshop at
• Dartmouth College in New
Hampshire
• Along with Marvin Minsky,
Claude Shannon, and Nathaniel
Rochester
Machine Learning
Sub-objectives of AI
Artificial
Intelligence
Natural
language
processing
Navigate
Represent
Knowledge
ReasoningPerception
Machine Learning
AI - Represent Knowledge
• Understanding and classifying terms or
things in world e.g.
• What is computer?
• What is a thought?
• What is a tool?
• Languages like lisp were created for the
same purpose
Machine Learning
AI - Reasoning
• Play puzzle game - Chess, Go, Mario
• Prove Geometry theorems
• Diagnose diseases
Machine Learning
AI - Navigate
• How to plan and navigate in the real world
• How to locate the destination?
• How to pick path?
• How to pick short path?
• How to avoid obstacles?
• How to move?
Machine Learning
AI - Natural Language Processing
• How to speak a language
• How to understand a language
• How to make sense out of a sentence
Machine Learning
AI - Perception
• How to we see things in the real world
• From sound, sight, touch, smell
Machine Learning
AI - Generalised Intelligence
• With these previous building blocks, the
following should emerge:
• Emotional Intelligence
• Creativity
• Reasoning
• Intuition
Machine Learning
AI - How to Achieve
Artificial Intelligence
Machine Learning
Rule Based Systems
Expert System
Domain Specific
Computing
Robotics
Deep
Learning
Machine Learning
AI - How to Achieve
Artificial Intelligence
Machine Learning
Rule Based Systems
Expert System
Domain Specific
Computing
Robotics
Deep
LearningWe will focus here.
Machine Learning
Machine Learning - Types
Human Supervision?
Machine Learning
How they generalize?
Learn Incrementally?
Machine Learning
Machine Learning - Types
Human Supervision?
Machine Learning
How they generalize?
Learn Incrementally?
Machine Learning
Machine Learning - Types
Human Supervision?
Supervised
Machine Learning
Unsupervised
Reinforcement
How they generalize?
Learn Incrementally?
Machine Learning
Machine Learning - Supervised Learning
Whether or not models are trained with human
supervision
Machine Learning
Machine Learning - Types
Human Supervision?
Supervised
Machine Learning
Unsupervised
Reinforcement
Classification
Regression
How they generalize?
Learn Incrementally?
Machine Learning
Machine Learning - Supervised Learning
Classification
● The training data we feed to the algorithm includes
○ The desired solutions, called labels
● Classification of spam filter is a supervised learning task
Machine Learning
Machine Learning - Supervised Learning
Classification
● Spam filter
○ Is trained with many example emails called training data.
○ Each email in the training data contains the label if it is spam or ham(not spam)
○ Models then learns to classify new emails if they are spam or ham
Classify new email as
Ham or Spam
Machine Learning
Machine Learning - Supervised Learning
Regression - Predict the price of the car (Value)
Machine Learning
Machine Learning - Supervised Learning
Regression
● Predict price of the car
○ Given a set of features called predictors such as
○ Mileage, age, brand etc
● To train the model
○ We have to give many examples of cars
○ Including their predictors and labels(prices)
Machine Learning
Machine Learning - Gradient Descent
• Instead of trying all lines, go into
the direction yielding better
results
Machine Learning
Machine Learning - Gradient Descent
● Imagine yourself blindfolded on the
mountainous terrain
● And you have to find the best lowest
point
● If your last step went higher, you will
go in opposite direction
● Other, you will keep going just faster
Machine Learning
Machine Learning - Types
Human Supervision?
Supervised
Machine Learning
Unsupervised
Reinforcement
Classification
Regression
How they generalize?
Learn Incrementally?
Machine Learning
Machine Learning - Unsupervised Learning
● The training data is unlabeled
● The system tries to learn without a teacher
Machine Learning
Machine Learning - Types
Human Supervision?
Supervised
Machine Learning
Unsupervised
Reinforcement
Classification
Regression
Clustering
How they generalize?
Learn Incrementally?
Machine Learning
Machine Learning - Unsupervised Learning
Clustering - Detect group of similar visitors in your blog
Machine Learning
Machine Learning - Unsupervised Learning
Clustering
● Detect group of similar visitors in blog
○ Notice the training set is unlabeled
● To train the model
○ We just feed the training set to clustering algorithm
○ At no point we tell the algorithm which group a visitor belongs to
○ It find groups without our help
Machine Learning
Machine Learning - Unsupervised Learning
Clustering
● It may notice that
○ 40% visitors are comic lovers and read the blog in evening
○ 20% visitors are sci-fi lovers and read the blog during weekends
● This data helps us in targeting our blog posts for each group
Machine Learning
Machine Learning - Unsupervised Learning
• In the form of a tree
• Nodes closer to each other are similar
Hierarchical Clustering - Bring similar elements together
Machine Learning
Machine Learning - Unsupervised Learning
Anomaly Detection - Detecting unusual credit card transactions to prevent
fraud
Machine Learning
Machine Learning - Types
Human Supervision?
Supervised
Machine Learning
Unsupervised
Reinforcement
Classification
Regression
Clustering
How they generalize?
Learn Incrementally?
Machine Learning
Machine Learning - Reinforcement Learning
Machine Learning
Machine Learning - Reinforcement Learning
● The learning system an agent in this context
○ Observes the environment
○ Selects and performs actions and
○ Get rewards or penalties in return
○ Learns by itself what is the best strategy (policy) to get most reward over time
Machine Learning
Machine Learning - Reinforcement Learning
Applications
● Used by robots to learn how to walk
● DeepMind’s AlphaGo
○ Which defeated world champion Lee Sedol at the game of Go
Machine Learning
Machine Learning - Types
Human Supervision?
Supervised
Machine Learning
Unsupervised
Reinforcement
Classification
Regression
Clustering
Batch Processing
How they generalize?
Learn Incrementally?
Online
Machine Learning
Machine Learning - Batch Learning
Machine Learning
Machine Learning - Batch Learning
● Offline learning
● System is incapable of learning incrementally
○ It must be trained offline using all the available data
● Takes lot of time and computing resources
○ everytime training happens on the entire data
Machine Learning
Machine Learning - Batch Learning
● Once the system is trained, it gets
○ Pushed to production
○ Runs without learning anymore
○ Just applies what it has learned offline
Machine Learning
Machine Learning - Online Learning
Machine Learning
Machine Learning - Types
Human Supervision?
Supervised
Machine Learning
Unsupervised
Reinforcement
Classification
Regression
Clustering
Batch Processing
How they generalize?
Model based
Learn Incrementally?
Online
Instance Based
Machine Learning
Machine Learning - Instance-based Learning
Machine Learning
Machine Learning - Instance-Based Learning
● Most trivial form of learning is
○ Learn by heart
● The system learns the examples by heart
● Then generalizes to new cases using a similarity measure
Machine Learning
Machine Learning - Instance-Based Learning
Example
● Spam filter flags emails
○ That are identical to known spam emails (emails marked spam by users)
○ Also the emails which are similar to known spam emails
○ This requires measure of similarity between two emails
○ A basic similarity measures between two emails can be
■ Count the number of words they have in common
Machine Learning
Machine Learning - Model-based Learning
Machine Learning
Machine Learning - Model-Based Learning
● Another way to generalize from a set of examples
○ Build a model of these examples
○ And then use model to make predictions
○ This is called inference
○ Hope that model will generalize well
○ We will learn more about it in next session
Machine Learning
Machine Learning - Artificial Neural Network(ANN)
Computing systems inspired by the biological neural networks that constitute animal
brains.
Machine Learning
Machine Learning - Artificial Neural Network(ANN)
• Learn (progressively improve
performance)
• To do tasks by considering examples
• Generally without task-specific
programming
• Example: Based on image - cat or no
cat?
Machine Learning
Machine Learning - Deep Learning
Each Neuron
Hot Water Cold Water
Each Neuron is like the knob.
Machine Learning
Machine Learning - Deep Learning
Each Neuron
Hot Water Cold Water
Each Neuron is like the knob.
Soap
Machine Learning
Deep Learning
Each Neuron
Hot Water Cold Water
What if there are many more parameters? So, physical input is conceptual input.
Soap
Person -
Male/Female
Climate?
Machine Learning
Deep Learning
Each Neuron
Hot Water Cold Water
We can construct many architectures….
Soap
Person -
Male/Female
Climate?
Machine Learning
Deep Learning
Multiple layers of neutrons
Convolutional Neural Network
Convolutional Neural Network
Convolutional Neural Network
● Although in 1996
○ IBM’s Deep Blue supercomputer
○ Beat the chess world champion Garry Kasparov
Convolutional Neural Network
Convolutional Neural Network
● Yet computers were unable to do trivial tasks such as
○ Detecting a puppy in a picture or
○ Recognizing spoken words
○ Until quite recently
Convolutional Neural Network
Convolutional Neural Network
● Convolutional neural networks (CNNs) emerged
○ From the study of the brain’s visual cortex, and
○ They have been used in image recognition since the 1980s.
Convolutional Neural Network
Convolutional Neural Network
● In the last few years
○ CNNs have managed to achieve superhuman performance
○ On some complex visual tasks
● And all this was possible because of
○ Increase in computational power
○ The amount of available training data
○ And the tricks presented in last chapter on training deep neural nets
Convolutional Neural Network
Convolutional Neural Network
● Today CNNs power
○ Image search services
○ Self-driving cars
○ Automatic video classification systems
○ Voice recognition and
○ Natural language processing - NLP
Convolutional Neural Network
Convolutional Neural Network
● In this chapter we will present
○ Where CNNs came from
○ What their building blocks looks like and
○ How to implement them using TensorFlow
● Then we will present some of the best CNN architectures
Convolutional Neural Network
Convolutional Neural Network
The Architecture of the Visual Cortex
Convolutional Neural Network
Convolutional Neural Network
● In 1958 and 1959, David H. Hubel and Torsten Wiesel
○ Performed a series of experiments on cats and
○ Later on monkeys
● Their experiments gave crucial insights on the
○ Structure of the visual cortex
● They showed that many neurons in the visual cortex
○ Have a small local receptive field
○ Meaning they react only to
○ Visual stimuli located in a limited region of the visual field
Convolutional Neural Network
Convolutional Neural Network
Local receptive fields in the visual cortex
Convolutional Neural Network
Convolutional Neural Network
Question
Why not simply use a regular deep network with fully connected
layers for image recognition tasks?
Convolutional Neural Network
Convolutional Neural Network
Answer
● Deep neural network work fine for small images such as MNIST
● But they break for larger images because of
○ Huge number of parameters
● For example
○ A 100x100 image has 10,000 pixels
○ If the first layer has 1,000 neurons (which is a very small number)
○ This means a total of 10 million connections, that too in first layer
○ This will require a lot of computing power
● CNNs solve this problem by using partially connected layers
Convolutional Neural Network
Convolutional Neural Network
Convolutional Layer
Convolutional Neural Network
● It is the most important
building block of a CNN
● Neurons in the first
convolutional layer are not
connected to every single
pixel in the input image , but
only to pixels in their
receptive fields
Convolutional Layer
Convolutional Neural Network
● In turn, each neuron in the
second convolutional layer is
connected only to neurons
located within a small
rectangle in the first layer.
● This architecture allows the
network to concentrate on
low-level features in the first
hidden layer, then assemble
them into higher-level
features in the next hidden
layer, and so on.
Convolutional Layer
Convolutional Neural Network
● This hierarchical structure is
common in real-world images,
which is one of the reasons
why CNNs work so well for
image recognition.
Convolutional Layer
Convolutional Neural Network
Convolutional Layer
Stride
This figure shows how the layers of CNN are formed
Convolutional Neural Network
CNN Architectures
Distinguishing dog Breeds based
on pics may require really
complex nerual network.
Recurrent Neural Network
Recurrent Neural Network
Recurrent Neural Network
● Predicting the future is what we do all the time
○ Finishing a friend’s sentence
○ Anticipating the smell of coffee at the breakfast or
○ Catching the ball in the field
● In this chapter, we will cover RNN
○ Networks which can predict future
● Unlike all the nets we have discussed so far
○ RNN can work on sequences of arbitrary lengths
○ Rather than on fixed-sized inputs
Recurrent Neural Network
Recurrent Neural Network - Applications
● RNN can analyze time series data
○ Such as stock prices, and
○ Tell you when to buy or sell
Recurrent Neural Network
Recurrent Neural Network - Applications
● In autonomous driving systems, RNN can
○ Anticipate car trajectories and
○ Help avoid accidents
Recurrent Neural Network
Recurrent Neural Network - Applications
● RNN can take sentences, documents, or audio samples as input and
○ Make them extremely useful
○ For natural language processing (NLP) systems such as
■ Automatic translation
■ Speech-to-text or
■ Sentiment analysis
Recurrent Neural Network
Recurrent Neural Network - Applications
● RNNs’ ability to anticipate also makes them capable of surprising creativity.
○ You can ask them to predict which are the most likely next notes in a
melody
○ Then randomly pick one of these notes and play it.
○ Then ask the net for the next most likely notes, play it, and repeat the
process again and again.
Here is an example melody produced by Google’s Magenta project
Recurrent Neural Network
Recurrent Neural Network
● In this chapter we will learn about
○ Fundamental concepts in RNNs
○ The main problem RNNs face
○ And the solution to the problems
○ How to implement RNNs
● Finally, we will take a look at the
○ Architecture of a machine translation system
Recurrent Neural Network
Recurrent Neurons
Recurrent Neural Network
Recurrent Neurons
● Up to now we have mostly looked at feedforward neural networks
○ Where the activations flow only in one direction
○ From the input layer to the output layer
● RNN looks much like a feedforward neural network
○ Except it also has connections pointing backward
Recurrent Neural Network
Recurrent Neurons
● Let’s look at the simplest possible RNN
○ Composed of just one neuron receiving inputs
○ Producing an output, and
○ Sending that output back to itself
Input
Output
Sending output back to itself
Recurrent Neural Network
Recurrent Neurons
● At each time step t (also called a frame)
○ This recurrent neuron receives the inputs x(t)
○ As well as its own output from the previous time step y(t–1)
A recurrent neuron (left), unrolled through time (right)
Recurrent Neural Network
● For example, at the first
step the word “Je” may
have a probability of
20%, “Tu” may have a
probability of 1%, and so
on
● The word with the
highest probability is
output
Machine Translation
An Encoder–Decoder Network for Machine Translation
Reinforcement Learning
Learning to Optimize Rewards
Reinforcement Learning
Reinforcement Learning
● In Reinforcement Learning
○ A software agent makes observations and
○ Takes actions within an environment and
○ In return it receives rewards
Learning to Optimize Rewards
Reinforcement Learning
Goal?
Learning to Optimize Rewards
Reinforcement Learning
Goal
Learn how to take actions in order to maximize
reward
Learning to Optimize Rewards
Reinforcement Learning
● In short, the agent acts in the environment and
○ Learns by trial and error to
○ Maximize its reward
Learning to Optimize Rewards
Reinforcement Learning
So how can we apply this in real-life applications?
Learning to Optimize Rewards
Reinforcement Learning
Learning to Optimize Rewards - Walking Robot
Reinforcement Learning
● Agent - Program controlling a walking robot
● Environment - Real world
● The agent observes the environment through a set of sensors such as
○ Cameras and touch sensors
● Actions - Sending signals to activate motors
Learning to Optimize Rewards - Walking Robot
Reinforcement Learning
● It may be programmed to get
○ Positive rewards whenever it approaches the target destination and
○ Negative rewards whenever it
■ Wastes time
■ Goes in the wrong direction or
■ Falls down
Learning to Optimize Rewards - Walking Robot
Reinforcement Learning
Learning to Optimize Rewards - Ms. Pac-Man
Reinforcement Learning
● Agent - Program controlling Ms. Pac-Man
● Environment - Simulation of the Atari game
● Actions - Nine possible joystick positions
● Observations - Screenshots
● Rewards - Game points
Learning to Optimize Rewards - Ms. Pac-Man
Reinforcement Learning
Learning to Optimize Rewards - Thermostat
Reinforcement Learning
● Agent - Thermostat
○ Please note, the agent does not have to control a
○ Physically (or virtually) moving thing
● Rewards -
○ Positive rewards whenever agent is close to the target temperature
○ Negative rewards when humans need to tweak the temperature
● Important - Agent must learn to anticipate human needs
Learning to Optimize Rewards - Thermostat
Reinforcement Learning
Learning to Optimize Rewards - Auto Trader
Reinforcement Learning
● Agent -
○ Observes stock market prices and
○ Decide how much to buy or sell every second
● Rewards - The monetary gains and losses
Learning to Optimize Rewards - Auto Trader
Reinforcement Learning
● There are many other examples such as
○ Self-driving cars
○ Placing ads on a web page or
○ Controlling where an image classification system
■ Should focus its attention
Learning to Optimize Rewards
Reinforcement Learning
● Note that there may not be any positive rewards at all
● For example
○ The agent may move around in a maze
○ Getting a negative reward at every time step
○ So it better find the exit as quickly as possible
Learning to Optimize Rewards
Reinforcement Learning
Policy Search
Reinforcement Learning
● The algorithm used by the software agent to
○ Determine its actions is called its policy
● For example, the policy could be a neural network
○ Taking observations as inputs and
○ Outputting the action to take
Policy Search
Machine Learning
Machine Learning - Who is Using?
Almost Everyone
Machine Learning
Google Translate & Auto Draw
More use cases: https://aiexperiments.withgoogle.com/
Machine Learning
TensorFlow - Demo
http://playground.tensorflow.org/
Machine Learning
Deep Learning Frameworks
Machine Learning
Machine Learning Frameworks
MLlib - Distributed Simple
Machine Learning
Learn More?
Machine Learning Courses
Machine Learning
Specialization
Machine Learning
Questions?
https://discuss.cloudxlab.com
reachus@cloudxlab.com

Deep Learning Overview

  • 1.
    Agenda 1. Introduction toBasic Terms and how they fit together: ○ AI, Big Data, Machine Learning, Deep Learning, ○ IOT, Neural Networks 2. Brief overview of use case of Deep Learning 3. How to Approach a Deep Learning Problem: ○ How to approach? ○ Which Tools? ○ Which Algorithms? 4. Questions & Answers
  • 2.
  • 3.
    About CloudxLab Videos QuizzesHands-On Projects Case Studies Real Life Use Cases Making learning fun and for life
  • 4.
  • 5.
    Automated Hands-on Assessments ProblemStatement Hands On Assessment
  • 6.
  • 7.
    Automated Hands-on Assessments PythonAssessment Jupyter Notebook
  • 8.
    Automated Hands-on Assessments PythonAssessment Jupyter Notebook
  • 9.
    Machine Learning with Python -Scikit Learn Course Objective
  • 10.
    Course Instructor Sandeep Giri WorkedOn Large Scale Computing Graduated from IIT Roorkee Software Engineer Loves Explaining Technologies Founder
  • 11.
    Machine Learning What IsMachine Learning? Field of study that gives "computers the ability to learn without being explicitly programmed" -- Arthur Samuel, 1959
  • 12.
    Machine Learning What IsMachine Learning? Let us understand it with real use case...
  • 13.
    Machine Learning Have YouPlayed Mario? How much time did it take you to learn & win the princess?
  • 14.
    Machine Learning Have YouPlayed Mario? Did Anyone teach you?
  • 15.
  • 16.
    Machine Learning How AboutAutomating it? • Program Learns to Play Mario
  • 17.
    Machine Learning How AboutAutomating it? • Program Learns to Play Mario • Observes the game & pressed keys
  • 18.
    Machine Learning How AboutAutomating it? • Program Learns to Play Mario • Observes the game & pressed keys • Maximises Score
  • 19.
  • 20.
    Machine Learning How AboutAutomating it? ● So, the program learnt to play ○ Mario ○ And Other games ○ Without any programming
  • 21.
    Machine Learning Question To makethis program learn any other games such as PacMan we will have to 1. Write new rules as per the game 2. Just hook it to new game and let it play for a while
  • 22.
    Machine Learning Question To makethis program learn any other games such as PacMan we will have to 1. Write new rules as per the game 2. Just hook it to new game and let it play for a while
  • 23.
    Machine Learning Gather dataand automatically solve problems Imagine Doing The Same For Life
  • 24.
    Machine Learning The MachineLearning Tsunami - 1 ● Self driving cars on the roads
  • 25.
    Machine Learning The MachineLearning Tsunami - 2 ● Netflix movies recommendations
  • 26.
    Machine Learning The MachineLearning Tsunami - 3 ● Amazon product recommendations
  • 27.
    Machine Learning The MachineLearning Tsunami - 4 ● Accurate results in Google Search
  • 28.
    Machine Learning The MachineLearning Tsunami - 5 ● Speech recognition in your smartphone
  • 29.
    Machine Learning Question What dowe need to ● Gather Data ● And automatically solving the problem? IntelligenceData +
  • 30.
    Machine Learning Collect Dataor Take Actions - IOT Phone & Devices Cheaper, faster and smaller Connectivity Wifi, 4G, NFC, GPS
  • 31.
    Machine Learning Intelligence -Traditional vs ML. How you would write a spam filter?
  • 32.
    Machine Learning Intelligence -Spam Filter - Traditional Approach 21 3
  • 33.
    Machine Learning Intelligence -Spam Filter - Traditional Approach Problems?
  • 34.
    Machine Learning Intelligence -Spam Filter - Traditional Approach ● Problem is not trivial ○ Program will likely become a long list of complex rules ○ Pretty hard to maintain ● If spammers notice that ○ All their emails containing “4U” are blocked ○ They might start writing “For U” instead ○ If spammers keep working around spam filter, we will need to keep writing new rules forever Problems?
  • 35.
    Machine Learning Intelligence -Spam Filter - ML Approach
  • 36.
    Machine Learning Intelligence -Spam Filter - ML Approach ● A spam filter based on Machine Learning techniques automatically learns ○ Which words and phrases are good predictors of spam ○ By detecting unusually frequent patterns of words ● The program will be ○ Much shorter ○ Easier to maintain ○ Most likely more accurate than traditional approach
  • 37.
    Machine Learning Intelligence -Spam Filter - ML Approach ● Unlike traditional approach, ML techniques automatically notice that ○ “For U” has become unusually frequent in spam flagged by users and ○ It starts flagging them without our intervention
  • 38.
    Machine Learning Intelligence -Spam Filter - ML Approach Can help humans learn ● ML algorithms can be inspected to see what they have learned ● Spam filter after enough training ○ Reveals combinations of words that it believes are best predictors of spam ○ May reveal unsuspected correlations or new trend and ○ Lead to a better understanding of the problem for humans
  • 39.
    Machine Learning Intelligence -Spam Filter - ML Approach Can help humans learn
  • 40.
    Machine Learning What isAI? Artificial intelligence (AI): The intelligence exhibited by machines
  • 41.
    Machine Learning What isAI? • The theory and development of computer systems
  • 42.
    Machine Learning What isAI? • The theory and development of computer systems • To perform tasks requiring human intelligence such as
  • 43.
    Machine Learning What isAI? • The theory and development of computer systems • To perform tasks requiring human intelligence such as • Visual perception
  • 44.
    Machine Learning What isAI? • The theory and development of computer systems • To perform tasks requiring human intelligence such as • Visual perception • Speech Recognition
  • 45.
    Machine Learning What isAI? • The theory and development of computer systems • To perform tasks requiring human intelligence such as • Visual perception • Speech Recognition • Decision Making
  • 46.
    Machine Learning What isAI? • The theory and development of computer systems • To perform tasks requiring human intelligence such as • Visual perception • Speech Recognition • Decision Making • Translation between languages
  • 47.
    Machine Learning History -Summer of 1956 • The term artificial intelligence was coined by • John McCarthy • In a workshop at • Dartmouth College in New Hampshire • Along with Marvin Minsky, Claude Shannon, and Nathaniel Rochester
  • 48.
    Machine Learning Sub-objectives ofAI Artificial Intelligence Natural language processing Navigate Represent Knowledge ReasoningPerception
  • 49.
    Machine Learning AI -Represent Knowledge • Understanding and classifying terms or things in world e.g. • What is computer? • What is a thought? • What is a tool? • Languages like lisp were created for the same purpose
  • 50.
    Machine Learning AI -Reasoning • Play puzzle game - Chess, Go, Mario • Prove Geometry theorems • Diagnose diseases
  • 51.
    Machine Learning AI -Navigate • How to plan and navigate in the real world • How to locate the destination? • How to pick path? • How to pick short path? • How to avoid obstacles? • How to move?
  • 52.
    Machine Learning AI -Natural Language Processing • How to speak a language • How to understand a language • How to make sense out of a sentence
  • 53.
    Machine Learning AI -Perception • How to we see things in the real world • From sound, sight, touch, smell
  • 54.
    Machine Learning AI -Generalised Intelligence • With these previous building blocks, the following should emerge: • Emotional Intelligence • Creativity • Reasoning • Intuition
  • 55.
    Machine Learning AI -How to Achieve Artificial Intelligence Machine Learning Rule Based Systems Expert System Domain Specific Computing Robotics Deep Learning
  • 56.
    Machine Learning AI -How to Achieve Artificial Intelligence Machine Learning Rule Based Systems Expert System Domain Specific Computing Robotics Deep LearningWe will focus here.
  • 57.
    Machine Learning Machine Learning- Types Human Supervision? Machine Learning How they generalize? Learn Incrementally?
  • 58.
    Machine Learning Machine Learning- Types Human Supervision? Machine Learning How they generalize? Learn Incrementally?
  • 59.
    Machine Learning Machine Learning- Types Human Supervision? Supervised Machine Learning Unsupervised Reinforcement How they generalize? Learn Incrementally?
  • 60.
    Machine Learning Machine Learning- Supervised Learning Whether or not models are trained with human supervision
  • 61.
    Machine Learning Machine Learning- Types Human Supervision? Supervised Machine Learning Unsupervised Reinforcement Classification Regression How they generalize? Learn Incrementally?
  • 62.
    Machine Learning Machine Learning- Supervised Learning Classification ● The training data we feed to the algorithm includes ○ The desired solutions, called labels ● Classification of spam filter is a supervised learning task
  • 63.
    Machine Learning Machine Learning- Supervised Learning Classification ● Spam filter ○ Is trained with many example emails called training data. ○ Each email in the training data contains the label if it is spam or ham(not spam) ○ Models then learns to classify new emails if they are spam or ham Classify new email as Ham or Spam
  • 64.
    Machine Learning Machine Learning- Supervised Learning Regression - Predict the price of the car (Value)
  • 65.
    Machine Learning Machine Learning- Supervised Learning Regression ● Predict price of the car ○ Given a set of features called predictors such as ○ Mileage, age, brand etc ● To train the model ○ We have to give many examples of cars ○ Including their predictors and labels(prices)
  • 66.
    Machine Learning Machine Learning- Gradient Descent • Instead of trying all lines, go into the direction yielding better results
  • 67.
    Machine Learning Machine Learning- Gradient Descent ● Imagine yourself blindfolded on the mountainous terrain ● And you have to find the best lowest point ● If your last step went higher, you will go in opposite direction ● Other, you will keep going just faster
  • 68.
    Machine Learning Machine Learning- Types Human Supervision? Supervised Machine Learning Unsupervised Reinforcement Classification Regression How they generalize? Learn Incrementally?
  • 69.
    Machine Learning Machine Learning- Unsupervised Learning ● The training data is unlabeled ● The system tries to learn without a teacher
  • 70.
    Machine Learning Machine Learning- Types Human Supervision? Supervised Machine Learning Unsupervised Reinforcement Classification Regression Clustering How they generalize? Learn Incrementally?
  • 71.
    Machine Learning Machine Learning- Unsupervised Learning Clustering - Detect group of similar visitors in your blog
  • 72.
    Machine Learning Machine Learning- Unsupervised Learning Clustering ● Detect group of similar visitors in blog ○ Notice the training set is unlabeled ● To train the model ○ We just feed the training set to clustering algorithm ○ At no point we tell the algorithm which group a visitor belongs to ○ It find groups without our help
  • 73.
    Machine Learning Machine Learning- Unsupervised Learning Clustering ● It may notice that ○ 40% visitors are comic lovers and read the blog in evening ○ 20% visitors are sci-fi lovers and read the blog during weekends ● This data helps us in targeting our blog posts for each group
  • 74.
    Machine Learning Machine Learning- Unsupervised Learning • In the form of a tree • Nodes closer to each other are similar Hierarchical Clustering - Bring similar elements together
  • 75.
    Machine Learning Machine Learning- Unsupervised Learning Anomaly Detection - Detecting unusual credit card transactions to prevent fraud
  • 76.
    Machine Learning Machine Learning- Types Human Supervision? Supervised Machine Learning Unsupervised Reinforcement Classification Regression Clustering How they generalize? Learn Incrementally?
  • 77.
    Machine Learning Machine Learning- Reinforcement Learning
  • 78.
    Machine Learning Machine Learning- Reinforcement Learning ● The learning system an agent in this context ○ Observes the environment ○ Selects and performs actions and ○ Get rewards or penalties in return ○ Learns by itself what is the best strategy (policy) to get most reward over time
  • 79.
    Machine Learning Machine Learning- Reinforcement Learning Applications ● Used by robots to learn how to walk ● DeepMind’s AlphaGo ○ Which defeated world champion Lee Sedol at the game of Go
  • 80.
    Machine Learning Machine Learning- Types Human Supervision? Supervised Machine Learning Unsupervised Reinforcement Classification Regression Clustering Batch Processing How they generalize? Learn Incrementally? Online
  • 81.
  • 82.
    Machine Learning Machine Learning- Batch Learning ● Offline learning ● System is incapable of learning incrementally ○ It must be trained offline using all the available data ● Takes lot of time and computing resources ○ everytime training happens on the entire data
  • 83.
    Machine Learning Machine Learning- Batch Learning ● Once the system is trained, it gets ○ Pushed to production ○ Runs without learning anymore ○ Just applies what it has learned offline
  • 84.
  • 85.
    Machine Learning Machine Learning- Types Human Supervision? Supervised Machine Learning Unsupervised Reinforcement Classification Regression Clustering Batch Processing How they generalize? Model based Learn Incrementally? Online Instance Based
  • 86.
    Machine Learning Machine Learning- Instance-based Learning
  • 87.
    Machine Learning Machine Learning- Instance-Based Learning ● Most trivial form of learning is ○ Learn by heart ● The system learns the examples by heart ● Then generalizes to new cases using a similarity measure
  • 88.
    Machine Learning Machine Learning- Instance-Based Learning Example ● Spam filter flags emails ○ That are identical to known spam emails (emails marked spam by users) ○ Also the emails which are similar to known spam emails ○ This requires measure of similarity between two emails ○ A basic similarity measures between two emails can be ■ Count the number of words they have in common
  • 89.
    Machine Learning Machine Learning- Model-based Learning
  • 90.
    Machine Learning Machine Learning- Model-Based Learning ● Another way to generalize from a set of examples ○ Build a model of these examples ○ And then use model to make predictions ○ This is called inference ○ Hope that model will generalize well ○ We will learn more about it in next session
  • 91.
    Machine Learning Machine Learning- Artificial Neural Network(ANN) Computing systems inspired by the biological neural networks that constitute animal brains.
  • 92.
    Machine Learning Machine Learning- Artificial Neural Network(ANN) • Learn (progressively improve performance) • To do tasks by considering examples • Generally without task-specific programming • Example: Based on image - cat or no cat?
  • 93.
    Machine Learning Machine Learning- Deep Learning Each Neuron Hot Water Cold Water Each Neuron is like the knob.
  • 94.
    Machine Learning Machine Learning- Deep Learning Each Neuron Hot Water Cold Water Each Neuron is like the knob. Soap
  • 95.
    Machine Learning Deep Learning EachNeuron Hot Water Cold Water What if there are many more parameters? So, physical input is conceptual input. Soap Person - Male/Female Climate?
  • 96.
    Machine Learning Deep Learning EachNeuron Hot Water Cold Water We can construct many architectures…. Soap Person - Male/Female Climate?
  • 97.
  • 98.
  • 99.
    Convolutional Neural Network ConvolutionalNeural Network ● Although in 1996 ○ IBM’s Deep Blue supercomputer ○ Beat the chess world champion Garry Kasparov
  • 100.
    Convolutional Neural Network ConvolutionalNeural Network ● Yet computers were unable to do trivial tasks such as ○ Detecting a puppy in a picture or ○ Recognizing spoken words ○ Until quite recently
  • 101.
    Convolutional Neural Network ConvolutionalNeural Network ● Convolutional neural networks (CNNs) emerged ○ From the study of the brain’s visual cortex, and ○ They have been used in image recognition since the 1980s.
  • 102.
    Convolutional Neural Network ConvolutionalNeural Network ● In the last few years ○ CNNs have managed to achieve superhuman performance ○ On some complex visual tasks ● And all this was possible because of ○ Increase in computational power ○ The amount of available training data ○ And the tricks presented in last chapter on training deep neural nets
  • 103.
    Convolutional Neural Network ConvolutionalNeural Network ● Today CNNs power ○ Image search services ○ Self-driving cars ○ Automatic video classification systems ○ Voice recognition and ○ Natural language processing - NLP
  • 104.
    Convolutional Neural Network ConvolutionalNeural Network ● In this chapter we will present ○ Where CNNs came from ○ What their building blocks looks like and ○ How to implement them using TensorFlow ● Then we will present some of the best CNN architectures
  • 105.
    Convolutional Neural Network ConvolutionalNeural Network The Architecture of the Visual Cortex
  • 106.
    Convolutional Neural Network ConvolutionalNeural Network ● In 1958 and 1959, David H. Hubel and Torsten Wiesel ○ Performed a series of experiments on cats and ○ Later on monkeys ● Their experiments gave crucial insights on the ○ Structure of the visual cortex ● They showed that many neurons in the visual cortex ○ Have a small local receptive field ○ Meaning they react only to ○ Visual stimuli located in a limited region of the visual field
  • 107.
    Convolutional Neural Network ConvolutionalNeural Network Local receptive fields in the visual cortex
  • 108.
    Convolutional Neural Network ConvolutionalNeural Network Question Why not simply use a regular deep network with fully connected layers for image recognition tasks?
  • 109.
    Convolutional Neural Network ConvolutionalNeural Network Answer ● Deep neural network work fine for small images such as MNIST ● But they break for larger images because of ○ Huge number of parameters ● For example ○ A 100x100 image has 10,000 pixels ○ If the first layer has 1,000 neurons (which is a very small number) ○ This means a total of 10 million connections, that too in first layer ○ This will require a lot of computing power ● CNNs solve this problem by using partially connected layers
  • 110.
    Convolutional Neural Network ConvolutionalNeural Network Convolutional Layer
  • 111.
    Convolutional Neural Network ●It is the most important building block of a CNN ● Neurons in the first convolutional layer are not connected to every single pixel in the input image , but only to pixels in their receptive fields Convolutional Layer
  • 112.
    Convolutional Neural Network ●In turn, each neuron in the second convolutional layer is connected only to neurons located within a small rectangle in the first layer. ● This architecture allows the network to concentrate on low-level features in the first hidden layer, then assemble them into higher-level features in the next hidden layer, and so on. Convolutional Layer
  • 113.
    Convolutional Neural Network ●This hierarchical structure is common in real-world images, which is one of the reasons why CNNs work so well for image recognition. Convolutional Layer
  • 114.
    Convolutional Neural Network ConvolutionalLayer Stride This figure shows how the layers of CNN are formed
  • 115.
    Convolutional Neural Network CNNArchitectures Distinguishing dog Breeds based on pics may require really complex nerual network.
  • 116.
  • 117.
    Recurrent Neural Network RecurrentNeural Network ● Predicting the future is what we do all the time ○ Finishing a friend’s sentence ○ Anticipating the smell of coffee at the breakfast or ○ Catching the ball in the field ● In this chapter, we will cover RNN ○ Networks which can predict future ● Unlike all the nets we have discussed so far ○ RNN can work on sequences of arbitrary lengths ○ Rather than on fixed-sized inputs
  • 118.
    Recurrent Neural Network RecurrentNeural Network - Applications ● RNN can analyze time series data ○ Such as stock prices, and ○ Tell you when to buy or sell
  • 119.
    Recurrent Neural Network RecurrentNeural Network - Applications ● In autonomous driving systems, RNN can ○ Anticipate car trajectories and ○ Help avoid accidents
  • 120.
    Recurrent Neural Network RecurrentNeural Network - Applications ● RNN can take sentences, documents, or audio samples as input and ○ Make them extremely useful ○ For natural language processing (NLP) systems such as ■ Automatic translation ■ Speech-to-text or ■ Sentiment analysis
  • 121.
    Recurrent Neural Network RecurrentNeural Network - Applications ● RNNs’ ability to anticipate also makes them capable of surprising creativity. ○ You can ask them to predict which are the most likely next notes in a melody ○ Then randomly pick one of these notes and play it. ○ Then ask the net for the next most likely notes, play it, and repeat the process again and again. Here is an example melody produced by Google’s Magenta project
  • 122.
    Recurrent Neural Network RecurrentNeural Network ● In this chapter we will learn about ○ Fundamental concepts in RNNs ○ The main problem RNNs face ○ And the solution to the problems ○ How to implement RNNs ● Finally, we will take a look at the ○ Architecture of a machine translation system
  • 123.
  • 124.
    Recurrent Neural Network RecurrentNeurons ● Up to now we have mostly looked at feedforward neural networks ○ Where the activations flow only in one direction ○ From the input layer to the output layer ● RNN looks much like a feedforward neural network ○ Except it also has connections pointing backward
  • 125.
    Recurrent Neural Network RecurrentNeurons ● Let’s look at the simplest possible RNN ○ Composed of just one neuron receiving inputs ○ Producing an output, and ○ Sending that output back to itself Input Output Sending output back to itself
  • 126.
    Recurrent Neural Network RecurrentNeurons ● At each time step t (also called a frame) ○ This recurrent neuron receives the inputs x(t) ○ As well as its own output from the previous time step y(t–1) A recurrent neuron (left), unrolled through time (right)
  • 127.
    Recurrent Neural Network ●For example, at the first step the word “Je” may have a probability of 20%, “Tu” may have a probability of 1%, and so on ● The word with the highest probability is output Machine Translation An Encoder–Decoder Network for Machine Translation
  • 128.
    Reinforcement Learning Learning toOptimize Rewards Reinforcement Learning
  • 129.
    Reinforcement Learning ● InReinforcement Learning ○ A software agent makes observations and ○ Takes actions within an environment and ○ In return it receives rewards Learning to Optimize Rewards
  • 130.
  • 131.
    Reinforcement Learning Goal Learn howto take actions in order to maximize reward Learning to Optimize Rewards
  • 132.
    Reinforcement Learning ● Inshort, the agent acts in the environment and ○ Learns by trial and error to ○ Maximize its reward Learning to Optimize Rewards
  • 133.
    Reinforcement Learning So howcan we apply this in real-life applications? Learning to Optimize Rewards
  • 134.
    Reinforcement Learning Learning toOptimize Rewards - Walking Robot
  • 135.
    Reinforcement Learning ● Agent- Program controlling a walking robot ● Environment - Real world ● The agent observes the environment through a set of sensors such as ○ Cameras and touch sensors ● Actions - Sending signals to activate motors Learning to Optimize Rewards - Walking Robot
  • 136.
    Reinforcement Learning ● Itmay be programmed to get ○ Positive rewards whenever it approaches the target destination and ○ Negative rewards whenever it ■ Wastes time ■ Goes in the wrong direction or ■ Falls down Learning to Optimize Rewards - Walking Robot
  • 137.
    Reinforcement Learning Learning toOptimize Rewards - Ms. Pac-Man
  • 138.
    Reinforcement Learning ● Agent- Program controlling Ms. Pac-Man ● Environment - Simulation of the Atari game ● Actions - Nine possible joystick positions ● Observations - Screenshots ● Rewards - Game points Learning to Optimize Rewards - Ms. Pac-Man
  • 139.
    Reinforcement Learning Learning toOptimize Rewards - Thermostat
  • 140.
    Reinforcement Learning ● Agent- Thermostat ○ Please note, the agent does not have to control a ○ Physically (or virtually) moving thing ● Rewards - ○ Positive rewards whenever agent is close to the target temperature ○ Negative rewards when humans need to tweak the temperature ● Important - Agent must learn to anticipate human needs Learning to Optimize Rewards - Thermostat
  • 141.
    Reinforcement Learning Learning toOptimize Rewards - Auto Trader
  • 142.
    Reinforcement Learning ● Agent- ○ Observes stock market prices and ○ Decide how much to buy or sell every second ● Rewards - The monetary gains and losses Learning to Optimize Rewards - Auto Trader
  • 143.
    Reinforcement Learning ● Thereare many other examples such as ○ Self-driving cars ○ Placing ads on a web page or ○ Controlling where an image classification system ■ Should focus its attention Learning to Optimize Rewards
  • 144.
    Reinforcement Learning ● Notethat there may not be any positive rewards at all ● For example ○ The agent may move around in a maze ○ Getting a negative reward at every time step ○ So it better find the exit as quickly as possible Learning to Optimize Rewards
  • 145.
  • 146.
    Reinforcement Learning ● Thealgorithm used by the software agent to ○ Determine its actions is called its policy ● For example, the policy could be a neural network ○ Taking observations as inputs and ○ Outputting the action to take Policy Search
  • 147.
    Machine Learning Machine Learning- Who is Using? Almost Everyone
  • 148.
    Machine Learning Google Translate& Auto Draw More use cases: https://aiexperiments.withgoogle.com/
  • 149.
    Machine Learning TensorFlow -Demo http://playground.tensorflow.org/
  • 150.
  • 151.
    Machine Learning Machine LearningFrameworks MLlib - Distributed Simple
  • 152.
    Machine Learning Learn More? MachineLearning Courses Machine Learning Specialization Machine Learning
  • 153.