Question: answer thsi question:Write a program that answers the following questions. The program must be in . ipynb format, and runnable in Google Colab. In the
answer thsi question:Write a program that answers the following questions. The program must be in ipynb format, and runnable in Google Colab. In the program use separate code blocks to answer each question. The answers must be printed when the program runs.
Problem Assume the following nonlinear function. sin cos
Prepare a python program to estimate it Consider the following in your program:
Select two hidden layers where the first hidden layer has neurons, and the second hidden layer has neurons.
Generate random value for in the range of and calculate the correct output of that according to the above equation. Consider these samples as the training data set and train the neural network with these data. Use Mean Square Error for loss function, Adam for optimization and train the NN for epochs.
Generate more data points in the range of for testing the quality of NN Lets call the correct outputs y Calculate the prediction of your NN for these values call them yhat and compare them with the correct output value y Plot both y and yhat versus input x at the same figure.
Generate more data in the range of and add them to the test data set generated in step Repeat step and plot y and yhat for the whole test data set. Does your NN have extrapolation capability? Answer that in a text box appeared after the figure in your program
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
