How Does Gradient Descent Algorithm Work