I am trying to implement a Neural Network to identify a Nonlinear System. I have implemented a very simple system in simulink and on the basis of examples of its input and output I would like to have the NN to mimic its behaviour. The system is the followingenter image description here

The schema on the top (the one with the random number as inputs) generates the training set, while the second one (with the ramp as input) is used to check whether the NN behaves properly. The network is a two layer network with a hidden layer of tanh nodes and a linear output layer. I have implemented two versions of the network, one in which stochastic gradient descent is used (update at each step) and another one in which the update is performed in batch. At the moment I am focusing on the iterative solution. I have also implemented the train-validate-test procedure described in this post.

Here the parameters of the network:

  • learning rate: 1e-3;
  • number of hidden units: 15
  • number of samples: 10002
  • max epochs: 1000
  • error threshold: 0.07

I use the 80% of the example set to train the NN, 10% to compute the error and the remaining 10% to produce the output you can see below. However, I cannot make the network generalize the system for different types of inputs.

output during the last training cycle

test against remaining samples and different input

The first two plots show the training phase. The one on the left is the output at the last iteration of the training procedure, the one on the right the plot of the mean value of the error at the end of each training epoch. The last two plots shows the performance of the network on unseen data. The plot on the right is obtained using as input data from the examples set not used in any way for training. The one on the right is generated using a ramp as input and comparing it with the output of the system for the same input.

What am I doing wrong? The full code can be found here




1 Answer 1


It turned out that the problem was a normalization problem. In fact, I trained the Neural Network on a reference signal that was preprocessed and an output signal obtained with an unnormalized signal. This causes problems in case of nonlinear systems. Now I generate training outputs using a normalized inputs and everything works fine.

If anyone need more details, feel free to contact me

regards Andrea

  • $\begingroup$ Learning is good. $\endgroup$ Commented Oct 15, 2017 at 22:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.