Lecture 24 : Part 2 - Machine Learning Algorithms-XVIII

IIT Kanpur July 201
20 followers
Sep 6, 2024
[Music]
so students welcome back to the second
part of the lecture so in the last part
of lecture I talked about the EM
algorithm em algorithm means expectation
maximization algorithm try to understand
it if you are not understanding we will
get back to you
maybe the next lecture I'll give you
tell you some more things about that and
you know this algorithm is basically
based on very simple thing so first you
start with let me just explain to you
again then we can get back to it so what
we do is start with uh some initial
values start let's
say initial values
then you have a expectation
step I hope you understand what is
expectation
step we expect the same values of the
Hidden variables we follow the same
right I gave you a function
H that's what is your latent variable
function so we expect the Lattin
variables will follow the same function
that is what is the expectation step
once you do the expectation steps then
you the maximization
step there you are
applying maximiz remember that you
basically find the maximum lude
hypothesis maximum tells you that if
this H is not able to
satisfy my prediction of the Latin
variables why how I maximize it
basically I calculate distance that
distance is
maximized and uh so that's what it is
done if it's convergence fine if it is
not
converging fine yes it
stops if it is
s then again it go back to the
expectation so this is a iterative
process
right so remember this so now you know
we'll go to the another important
algorithm which is called PCF inent
compound analysis PC is something which
is wiely used in machine learning so
therefore we will not talk much details
about just to give you idea so as the
number of dimension of any problem
increases and number of possible
combination of features also will
increase exponentially
obviously if you have IND dimensional
things that suppose and so you have
number of features will also become
exponentially High I mean it's talking
about n Dimension means data sets so
this makes computationally very
difficult to obtain a representative
sample of data and also it is very
expensive to perform task using
clustering or
classifications many cases it has been
found like in case of some algorithms
they are very sensitive to number of
dimensions then it more data to achieve
some level of accuracy or lower
dimensional data so how do you address
this problem so we'll basically we'll
have a separate section of data
pre-processing data handling there we're
going to talk detail about detail about
this this can be address simply uh by
using feature engineering or feature
selection feature extractions correct
that is what is called PCA many people
call it Pon compound analysis because
discovered by pon
so this popular technique we'll talk a
detailed manner in when you discuss uh
data pre-processing techniques in lat
part of this
course so now we move on to the Deep
learning okay so this are all machine
learning algorithms what are already
discussed supervised unsupervised
different kinds of algorithms and we
spent quite a lot on lectures almost
like a 10 lectures I spend on machine
learning algorithm because that is the
heart of the course now now we'll talk
about deep learning algorithms this is
also very important for you to
learn as you know I showed you this
slide at the beginning of my lecture
that AI has two parts machine learning
and deep learning right and machines can
understand and achieve specific
goals simply by using this learning
approaches so deep learning means you
are using much better techniques to
learn things right that's what is the
meaning of De learning for lemman point
of view but is it so well what is deep
learning deep learning mimics the intrig
neural networks of a human brain
remember this we process data much
intelligently that is the human brain is
so can I mimic this intricate neural
network that's what is deep learning
does in this process it enables
computers to autonomously discover
patterns it doesn't require any kind of
you know other kind of things help or
something it's can autonom discover
patterns right for us I told you right
if I childhood I've seen a cycle and a
car and then I can immediately
differentiate when I see a new cycle or
new car that is called autonomous
discovery of patterns many cases even
much better decision making proc things
can be done like it can make decision
from vast amount of unstructured data
unru can be text also right I talked
about it it can be text also and it
that's why it is used in various domains
like computer vision naal language
processings or what is called NLP
Healthcare
Diagnostics not even that even
autonomous diving also possible you
probably heard of some cars made by
companies like Google others which can
automatically drive right so deep
learning uses this
technology so it's typically based on
artificial neural network structure but
it is used as more integrate neural
networks and you know it has in enn we
have talked about it has many layers of
interc conducted nodes and they are
called neurons and that can work
together right that's what is done so in
a specifically it is a branch of machine
learning that is based Onn network
architecture and this uses layer of
interconnected neurons so in a fully
connected D Network there will is an
input layer and there is also an output
layer and there will be many hidden
layers so in a deep learning you can
have hundreds of thousands of hidden
layers possible that's what happened in
case of our human brain integrate inal
network connections can do that so in a
nut cell so what the difference between
machine learning and deep
learning machine learning is apply
statistical algorithm to learn the
hidden patterns and relationship to n
but deep learning uses artificial neural
network architecture to learn these
hidden patterns and relationships
remember this machine learning can work
a smaller amount number of data sets but
deep learning requires large data sets
compared to machine learning so
therefore machine learning is good for
lowlevel task what what you do but you
know it's not lowlevel task lot of task
we do in machine learning basically a
high level task and they are very good
for complex task like that's de learning
because it is handling large am data is
very good for image processing or even
the language L language proc you know
there are many l languages if you want
to many of you are actually texting on
your you know messenger services and
words keep coming in your fingers you
don't have to search it right how does
it happen it happens because of the use
of di learning you will see that when
you are you doing messaging sometimes
you type one word automatically many
others pop up and you select right
that's uses this deep learning
methodology because it can actually do
this NLP or natural language posing very
nicely it can even use grammar correctly
and allow you to write a sentence many
times you that I know many of you write
email in Google or Gmail you can see
that I write a text automatically some
more things comes what comes to complete
the sentence so they can actually do
this kind of analysis this is a part of
deep learning
actually and it takes uh little time to
learn but it is very good methods so
what happen a model here in machine
learning is created by relevant features
which are manually extracted from the
images to detect the object of an object
in the image right but in case of deep
learning relevant features are
automatically extracted you don't have
to do manually from the images it is
like a end to endend learning process
that's what human does human any small
kid or something they started learning
something it will be end to end learning
it's is not like I learn bits and pieces
I learn the whole process if if I have
to walk from this room to other room so
I have to find the door and reach the
other room everything is learned but
machine learning uses bits and pieces
through that and that's why it less
complex easy to interpret results by
Deep learning because it uses artificial
neural network framework it is more
complex sometime people think it's like
a black box obviously because many of
these passenger techniques whatever you
see they use as a black box kind of
things and that's why results are not
easy to explain and machine learning
requires high performance Computing with
GPU but it this this Ma sorry de
learning machine learnings can be done
in CPUs or something so what are the
applications machine learning has first
like to understand first important
application is a computer
vision it can detect and recognize an
object it can classify images it can
segment images so you know in future
technology will be like that if you go
to airport and you know try you already
they have given all the informations and
you stand in front of the gr there will
be no security you can enter because of
the use of computer vision they'll
detect from your image of your face that
you are the right person or not they
don't need to you don't need to show any
ID card or anything that's what is the
ultimate things a computer vision can do
it can also use natural language
processing like automate text generation
I talked about it few minutes back it
can do language translation Google
translation does that right you type
something in English it will convert
into some Indian languages some other
languages or you you don't know Chinese
you can convert in English this is how
this NLP Works NLP Works using a deep
naring methodology it can do sentiment
analysis also whether you read a text
whether text is talking about laugh
talking about cry talking about some
other sentiments it can easily detect so
it's so powerful and obviously it can do
speech recognition which is much not
much higher level but it can can do even
much better spe
recommendations there's something else
also it can do which you will talk now
it's called reinforced learning and this
is used in game playing game playing
robotics Control Systems what is that
reinforced learning okay so you have
learned about supervised and
unsupervised learning so let's talk
about that about reinforced learning
supervised learning means you have a
predictive model based on both input as
well as the output data but in case of
on by learning you only input and you
have to group the data and interpret
that we have learned in the last 10
lectures or so but what is that un for
reinforcement learning it is a machine
learning technique which agent learns to
make decisions remember this in an
environment to maximize the reward
signal you have agent like when you play
games somebody is playing for you in the
in the in the games actually and you are
playing the joysticks you are playing
with the joysticks so that's like an
agent agent playing something and that
allows you to make decisions in an
environment to maximize the reward
signal re signal means you want to win
the game there are different levels of
the game once you start level one level
zero level one level two level three
level four right so the agent does
actually everything for on your behalf
but you are playing with the agent don't
worry that's what it is so agent
interacts with the environment by taking
actions and observing the results
remember this this is very important
rent actually interacts with environment
by taking actions and observing the
results rewards deep learning can be
used to learn policies even a set of
actions that maximizes the cumulative
reward over
time there are many deep learning
methods deep deep Cube networks deep
determining s policy gradient ddpg many
others are used to that so that I hope
it is I am clear right compared to unsup
learning this is a defund this is here
you are using a agent to do that okay so
let me explain to you a much better way
what is it I wrote Somewhere let me see
so this is Agent based learning is kind
of a allows you
to create games and Robotics a robot you
can control that and you can even
control the control systems so now the
question is since deep learning is based
on artificial NE network uh how the
brain works these slides I've shown you
earlier also so a brain is nothing but a
parallel computational information
processing
system okay it's like a par information
system it has a large number of networks
of elements which is nothing but a
neuron actually 10 billion neurons are
there and they parall process the data
how does it do so this is a neuron
typically this one I shown you right you
see these are the dendrites which are
nothing but input they collect the
signals okay if you are putting the hot
objects on your on a screen immediately
nervs will detect take the signal from
the temperature is rising right and then
it gives the signal to the body or that
is a nucleus it possesses that signal
and once it possess signal it will be
sent bya s synaptic link and then it
goes to action for an
output and this output of once one
neuron is input to the other neuron that
that's what it's called parallel
processing so one neuron will process it
data given output that output will used
by the another neuron of this second
neuron as an input and process further
so if it processes that way so what will
happen your quality of output will
slowly improve so you will be
immediately taking your hands off from
the hot objects that's what it does so
this level of intelligence is what is
done by the parallel posting of the
neurons in the human body
body and that's why we talk about
multi-layer perance okay
percepton uh this humans have the
ability to identif patterns very easily
right so whenever you know artificial
new networks Comm systems intend to imit
imitate that human learning capability
we have to create a this complex
architecture like we have in your brain
right that's what you have to do because
then only we can actually make a better
division making capability or better
Deion uh can be made easily with much
faster much higher accuracy so a percept
is simply a binary classification
algorithm remember this so that means it
can take either zero one it can take
zero means negative one means positive
right so unlike class algorithm this is
percep in this model using concept known
as essential unit of human brain or
neuron and percep is a simple uh
basically nothing but a simple learing
machine and it takes few out inputs Each
of which has a weight to signify how
important that input is we'll talk about
it and then generate an output is yes or
no however we can combine with other
percepton it can form an artificial
neuron Network right you can combine
many you know does those kind of things
so let me go back here yes this is what
it is a biological neuron as you see
here so you have inputs here we put
weights on that each inputs correct so
that's what it is you see there w0 x0 W1
X1 W2 x0 weights are placed depending
importance of a particular input okay
which one is more important than the
other and once you do that then you
Summit over and do some kind of a
analysis that's what your function is
apply certain function on the summation
summation is giving all the output
together right all the input together
sorry and this Summit over and then
applied then then actually used by the
AC functions to give an output
activation I told you it can be anything
can logarithmic functions it can be
exponential functions depending on your
use you need so that's what is done
let's talk about here so these are the
inputs you see here and then you put
some weights and then submit over so
after you wait submit over what you do
you put this to a activation function or
transform function you can see FX that
gives you output so now we can make many
layers between in that you're going to
have several activation functions which
can operate on on these kind of aspects
right so I can see here this input the
Ws sumission activation functions and
then this is giving you some Summit over
again and then output is obtained that's
what is artificial NE network does so in
a multier perception is nothing but
network is formed by teaming up
percepton with additional ones basically
they stacked like a several layers you
can see here several hidden layers are
stacked other input output and each per
in the first layer on the left is
nothing but input it seems output to the
all the percepts in the second layer and
so on there will be many such layers one
by one and do that and remember each
layer this thing is done this you know
weights activation everything is done so
output of each layer is input of the
next layer
that's why this parall procing is done
that's why this parall procing can be
done like a brain and this is a three
layer Network we have input hidden one h
l and one output you can see here and
you can have four more layers that's
what is called Deep neural network or
deep Learning Network and what the
difference between this and normal new
network I talked about it earlier also
difference is that MLP and newal network
is that it's basically decision making
functions uh that's different okay and
Neal Network that evolve from MLPs other
than activation functions can be used
more than 0 one it can use minus one
plus one also many other variables and
how does it work let's talk about a
little bit first is it takes the inputs
multiplies by the weights comput the sum
why do you do that because weights allow
you to percept to evaluate the relative
importance of each outputs and neural
algorithms learn by discovering better
and better weights as result of more
accurate
predictions okay that's why you have to
do different kinds of wets and then you
can tune the wets also which is very
common that is what is done in back
propagation I discussed with you can add
a bias Factor okay also like you can
number one multiply by wets and that's a
bias you can add a bias to it then after
you add it up you can put a bias uh this
are technical steps that Mak it possible
to move the activation function curve up
and down bias will allow the activation
function go up and down left and right
on the G right and that makes you to
fine tune the numerical outputs or
numerical values of these weights then
you do the activation function feed the
sum to this activation function
activation function Maps the input
values to the required output values the
input values can be 0o and one or is it
one and 100 between outputs can be zero
and one that's what is done and then
certain properties of activation
function especially it is a la linear it
must be La linear you know all our
decision making processes in brain is
basically La linear it's not linear
human brain is very complex Network and
then you get an output by that way so in
a multier perception output of one layer
perception is the input to the next
layer this I've been telling you again
and again so important aspects which
we'll discuss in the next class already
discussed about back propagation we'll
talk about hyper parameters tuning hyper
parameters and we'll talk about some
others Advanced structures also so let
me stop here so this is a very simple
descriptions of deep learning
we'll move into details of that in the
next two three lectures and discuss
their basic aspects thank you
[Music]
[Music]
[Music]
