Gradient Descent is an optimization algorithm used to minimize a function by iteratively moving in the direction of steepest descent…