Question: Doing Math With Python Chapter 7 Question 2 Please use python #2: Implement the Gradient Descent The gradient descent method is used to find the

Doing Math With Python Chapter 7 Question 2 Please use python
#2: Implement the Gradient Descent The gradient descent method is used to find the minimum value of a func- tion. Similar to the gradient ascent method, the gradient descent method is Solving Colculus Problems 205 an iterative method: we start with an initial value of the variable and gradu- ally get closer to the variable value that corresponds to the minimum value of the function. The step that gets us closer is the equation o new = xold where 2 is the step size and is the result of differentiating the function. Thus, the only difference from the gradient ascent method is how we obtain the value of x_new from x old. Your challenge is to implement a generic program using the gradient descent algorithm to find the minimum value of a single-variable function specified as input by the user. The program should also create a graph of the function and show all the intermediate values it found before find. ing the minimum. (You may want to refer to figure 7-5 on page 193.)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
