Deep learning

                                     DEEP LEARNING


* Artificial Intelligence is a capability of machine to imitiate intelligent human behavior

* Brain is nature gift it is god given to us , becoz it is natures that's why we called it as natural intelligence but if we take a machine or device and made to work like a brain , then it also becomes intelligent and because we are making it , so this is called Artificial Intelligence.

* Machine learning is subset of AI , and Deep Learning is subset of machine learning.

*There is some problem with machine learning that is they are not useful while working with high dimensional data as they give less accuracy and machine learning cannot solve crucial AI problems such as image recognization, speech recognization.

* if there are thousands of features u cannot solve this with machine learning , that's why deep learning comes to rescue

* Deep learning model are capable to focus on the right feature by themself, requiring little guidence from the programmer.

*Even if you have 1000 colum deep learning can solve it.

*They say if you have more data they give more accuracy.

* Having small data is problem with deep learning.

* Deep learning is implemented through neural network

*Our brain contain million of million neuron and group of neuron is called neural network

          ARTIFICIAL NEURAL NETWORK

*And because this is created by us that is why it is called Artificial neural network

* A layer is group of neuron and they are also called nodes

* Hm kah skte hai ki , deep learning is group of advanced machine learning algorithims

* it is signal which is transmitted between neurons , Axon and Dendrites receive and transmit the signal

*see what neuron does is , it takes the signal and process them and give the output this is how neuron will work

*the gap between the signal and neuron is called bridge and technical mantra of bridge is synapase.

* In deep learning these signals are called independent variable

* We generally standarize the data and gives it to the neuron

* output value (dependent variable ) can be continuous (price) , binary( yes/no) , categorical

* Neuron takes the wave which comes from signal, wave is in the form of binary 

*High level steps for Artificial neural network

#First step 

neuron takes the wave and multiplying it and then sum it ( multiplying means adding a weight)

# Second Step

Neuron apply a activation function (it is just like the sigmoid function)

# Third Step

then what we got we pass it to the output

* Activation function are of four type

# Threshold Function ( if you want to take yes or no)

#Sigmoid Function ( is for classification)

# Rectifier (for classification)

#Hyperbolic tangent

* If our dependent variable is binary ( 0 or 1) either we can use threshold or sigmoid

* We take input and give it to group of neuron , and all these group of neuron is called hidden layer and it is doing hidden processing , in hidden layer we generally use rectifier function

*In higher level our brain can think of one or two dimension but what deep learning do is it takes a group of combination this is called automatic feature extraction

* Basically whatever brain is doing in biological level now we are representing it into a mathematical level.

* y^ is predicted value and y is actual value

* yellow arrow are called forward propogation

* brinjal color arrow are called backward propogation

*after gettting a predicted value we get an error ,after getting an error again it goes back and do forward propogation

* this process is going again and again until it get predicted value = actual value when this happen we calculate the weight and this weight are called magnitude

* In backward propogation we are actually adjusting the weights ( the weight is near to 0 but not 0)

* if we plot the predicted value on x axis and all the error in y axis , the point where y axis is less is a minimum error

* kah skte hai ki minimum error is point where we stop the propogation

* Best point is point where we get an minimum error

* Gradient Descent is optimisation technique which calculate the minimum error

* In linear curve we use gradient descent but if there is non linear curve we did not get a best minimal error that is why we use stochastic gradient descent

* gradient descent mai hm sbse pahle saari row ka forward propogtion kr lete hai, fir ek sath saari row ko lete hai aur error calculate krte hai, but in stochastic gradient descent we use one row at a time and calculate an error

* so forward propogation , backward propogation and gradient descent are first , second , third mantras of Artificial neural network (ANN)

*epchos are one complete cycle

          Convolution neural network

* convolution neural network used for image processing


* Each image is group of pixels

* the more the intensity the more the feature of an image

* high level steps of convolutional neural network

1.Convolution

2. Max polling

3. Flattening

4. Full connection

Convolution

 Convolution is combination of integration and differentiation

* We take the image and convert it into 7 by 7 matrix

* then we are taking a 3 by 3 kernel(feature detector) and put it on input image and try to match the no. of times in same positon 1 appears in input image and 1 appear in feature detector.

* so in 7 by 7 matrix we apply a feature detector of 3 by 3 matrix and get 5 by 5 matrix , and what is special about these 5 by 5 matrix is that is it is eliminating zeros and focussing on most important features

* so convolutional neural network apply tense of tense of feature detector and gets lots of lots of matrix ( 5 by 5 ) and that is group of feature maps and that is called Convolutional layers

* so we have taken an image of person, things and then we take a several image of that person , thing looking in different directions and angles

* then we apply rectifier to convolutional layer

Max Pooling

* so here i will tell  u what max pooling is we got an 5 by 5 matrix and we max pooled it and made it to 3 by 3 matrix by extracting the most important features and that is what max pooling is 

* Actually what we are doing is we are trying to find the most important features of that thing

Flattening

* And after that flattening is done means converting the pooling layer into one dimension

*after flattening it become the input layer of artificial neural network

Full connection

* image - convolution - max pooling - flattening - input layer - hidden layer - output

------------------------

* ANN, RNN are done with numeric data where as convolutional neural network are used in image recognization  , speech recognization, and things like that 

 Recurrent Neural network

* In the recurrent neural networks , the output of one hidden layer  is going to be a input of another network that's why it is called  as  recurrent neural network

* there is some problem with recurrent neural network let us understand it with an example so if we take a single network , what happen is then when the backward propogation began , and when the backward propogation began what's happening is the weights in previous network is getting reassigned . In an effort to reduce the weights in one network weight in another network get reduced as a result of that in effort to reduce the error in this network the error in other network start increasing  that is called the infinite loop and that is the problem and this problem is also called vanishing gradient 

* Gradient means rate of change of error with respect to the time so if you move from right hand side to left hand side the error is reducing and it is called vanishing gradient and reverse is called exploding gradient.

* Solution to vanishing gradient

1. Weight initilization

2.  Echo state Network

3. Long short term memory networks (LSTMs)

* Solution to exploding gradient

1. Truncated Backward propogation

2. Penalities

3. Gradient Clipping

* LSTMs were developed to deal with the vanishing gradient problem

* Technical mantra of recurrent neural network is that is group of neural network



Comments

Popular posts from this blog

All about Machine learning

Machine Learning

OS in Python