MATLAB: Does the block created from a NEWPNN network using the GENSIM function give unexpected results

Deep Learning Toolboxgensimnetworksneuralnewpnnresultsimgensimulinksparseunexpected

I have created and trained a neural network using the NEWPNN function, and the output in MATLAB is correct. However, when I use GENSIM to create a block from this network, the output in Simulink does not appear to be correct. The output of the block is all ones.

Best Answer

This bug has been fixed in Release 14 Service Pack 3 (R14SP3). For previous product releases, read below for any possible workarounds:
The problem is that the data generated by your NEWPNN network is a sparse matrix. You can verify this by simulating your network using the same data with which you constructed it. MATLAB and Simulink handle sparse matrices differently. Therefore, you are not seeing the same results in Simulink.