Pe Dro
Pe Dro

Reputation: 3043

Doubtful predictions of Neural Network implemented in C++

I have created a Neural Network in C++ for approximating addition function y = x + y. I used a single hidden layer with 5 neurons. The values of x and y lie in the range 0 and 10. So before training, I normalized the training data(input as well as output data) by the Maximum value (2x10).

After my model makes the prediction (lying between 0 & 1), I de-normalize the prediction by multiplying it with 2x20. But, my result still shows a shift.

i.e, if the result (y) should have been predicted as 8, my network gives -12. And similarly, instead of 1, I get -19. To correct this shift, I added 20 to my predicted value. This is what I get: ignore the title, *f(x)= sin(x)*

ignore the title, f(x)= sin(x), where, Blue shows the actual result and Red shows predicted value(after I add 20 manually)

My question is: Is my network predicting well ? And is "adding 20 manually to the result" normal?

(P.S: Link to reference code, and Link to my problematic code)

Upvotes: 0

Views: 142

Answers (0)

Related Questions