Interview Question What Is Gradient Descent 1679467271
Interview Question What Is Gradient Descent 1679467271
Gradient Descent
in
Machine Learning ?
Gradient Descent is an optimization
algorithm that is commonly-used to train
machine learning models and neural
networks. Training data helps these
models learn over time, and the cost
function within gradient descent
specifically acts as a barometer,
gauging its accuracy with each iteration
of parameter updates.
Kehna kya chahte
ho?
Step1
Step2
Bach Gaya
Step3
Step4
Let’s take one mathematical
example.
Let’s say we have a function, 𝑦 = 𝑥 2 and
our objective is to find the value of x
where y is minimum. In other words, we
have to find the input x where the output
of this equation is minimum.
x f(x) = x 2 y
(input) (output)
x
Now, we will apply the same logic and
approach we used earlier to save
sumit.
Look for slope.
Take small steps toward the direction of
the slope.
What is the slope of the function 𝑦 = 𝑥 2 ?
The slope of any function is the derivative
of the function
2
y=x
Lets take derivative of y with respect to x
d d 2 Rule
(y) = (x ) d (x )= (nx n-1 )
dx dx
dx
dy
= 2x Slope of the
dx function y=x 2
We have the slope of the function
𝑦 = 𝑥 2which is 2𝑥
Now let’s go to the second step.
We will now, reduce the value of x towards the
direction of the slope from the current value
which is x = 6
What is the step size ?
Steps size will control the
speed at which we want to
descend. Here I don’t want to
be very fast or very slow, so the
tried and tested value is 0.01
but you may always play with
this value and tune it. This is
also known as a
HyperParameter.
After applying the formula , we will get
This is what Gradient Descent is
all about.
The best usage of Gradient Descent
can be seen in any Machine Learning
Algorithm which is having a Cost
Function to optimize.
1. Linear Regression
2. Logistic Regression
3. ANN
I hope now you are clear with
"What is Gradient Descent"
If you enjoyed this , please Share this with your
give this post a big thumbs up friends
SHARING IS CARING
SAVE
&
Follow For More