urta_hill - 2021-05-10T14:13:30+00:00
Question: NN function approximation: What's wrong with my code?
I have just started learning neural networks and have been stuck on a homework question for quite a while. the question is as follows: Design a feed forward multi-layer neural network to approximate the function y=sin(x1)+cos(x2). Here, -5
Expert Answer
Prashant Kumar answered .
2025-11-20
f you sort your y and ynet based upon input1, then you can see that the error is especially bad towards the right hand side (input1 close to 5). If you sort based upon input2, then there are multiple not-good places but especially towards input2 close to 5.
If you scatter(x1, x2), then at least for the run I did, the number of random samples close to x1 = 5 or x2 = 5 is not high.
I think you need more training data.
Not satisfied with the answer ?? ASK NOW