Question: in python: Gradient Descent - Objective : Implement the Gradient Descent to minimize the cost function ofa synthetic dataset generated froma non - linear function.

in python:
Gradient Descent-
Objective : Implement the Gradient Descent to minimize the cost function ofa synthetic dataset generated froma non-linear function.
1.Generate Shynthetic Data
-generate 200 randomly generated values of X between -10 and 10.
-generate the target variable y using the function 5x^4+2x^3+9x +12. This is your model.
- The bias term Xbias is initialized to 1. in python
2. Implant Gradient Descent
-Use the variables name compute_error to calculate the Root Mean Squared Error(RMSE) between the predicted and actual target values.
-define a function gradient descent to perform Grafient Descent and return the optimized weights, theta.
- Initialize the weights randomly.
3. Hyperparameters
-Run the existencexperiment with different learning rates(LR) and observe how it affects the convergence of the algorithm. Use: LR:0.001,0.01,0.0005.
-Display the final RMSE for each learning rate.
4. Submission
- Final output: should look like this: Learning Rate: 0.001; RMSE: XXXX.XXXX, where this is the computed error: Repeat for all 3 LRs.
Example:
Learning Rate: 0.001; RMSE: 3523.1301
Learning Rate: 0.01; RMSE: 9813.8717
Learning Rate: 0.0005; RMSE: 1332.2333

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!