Why do the outputs of a NARX Neural Network obtained with Simulink are different from the outputs obtained with Matlab script?

1 view (last 30 days)
I have created an NARX Neural Network with NN Toolbox (Matlab R2015b). It has 1 hidden layer, 5 hidden Neurons and a delay 1:2 for the Inputs and another 1:2 delay for the Output Feedback to the layer.
Once the NN is trained, the corresponding Simulink diagram is obtained by using 'gensim' (with the input mode set to 'workspace'). The input vector introduced from Workspace has in its first column the timestep and in the second, the data.
I am wondering why the outputs that I obtain with the code are different from the ones obtained in Simulink. The weights obtained with the code are the same used in Simulink. The fixed time step is 0.01, the solver is discrete and the stop time that I have stablished is 14.63 because I have 1463 data.
Does anyone know why this happens and how can I solve it?
Thank you very much in advance

Accepted Answer

Greg Heath
Greg Heath on 21 Dec 2016
The timeseries for inputs should be rows, not columns
Hope this helps.
Thank you for formally accepting my answer
Greg

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!