ML Lec-4
ML Lec-4
LECTURE-4
BY
Dr. Ramesh Kumar Thakur
Assistant Professor (II)
School Of Computer Engineering
v Gradient descent is an iterative optimization algorithm to find the minimum of a function. Here that function is
our Loss Function. We will use Mean Square Error (MSE) as Loss Function in this topic which is shown below:
� � � �
v E= �=�
[�� − (� + ���)]2 = �=�
(�� − �� )2
� �
v 4. We repeat this process until our loss function is a very small value or ideally 0 (which means 0 error or 100%
accuracy). The value of b and a that we are left with now will be the optimum values.
v Now going back to our analogy, b can be considered the current position of the person. D is equivalent to the
steepness of the slope and L can be the speed with which he moves. Now the new value of b that we calculate
using the above equation will be his next position, and L×D will be the size of the steps he will take.
v When the slope is more steep (D is more) he takes longer steps and when it is less steep (D is less), he takes
smaller steps.
v Finally he arrives at the bottom of the valley which corresponds to our loss = 0.
v Now with the optimum value of b and a our model is ready to make predictions !