Neural Network Toolbox backward compatibility

조회 수: 12(최근 30일)
David Nemati
David Nemati 2016년 11월 11일
답변: Johanna Pingel 2019년 2월 6일
I'm trying to use some tools that were designed to be integrated into Neural Network Toolbox 6.0.4 (the version which came with R2010a) with Matlab 2016a. I'm getting errors as a script that came with the tool defines two matrices P and T and then calls
net = newff(P,T,2); % create a NN with 2 nodes in the hidden layer
net.trainFcn = 'trainpso';
(newff became "obsolete" with R2010b. trainpso is a training function that comes in this add-in, designed to be called in the same manner that other train functions in NN Toolbox 6.0.4 are called.)
I run this script and it stops with an error at the last line I quoted. After clicking all the citations of code lines in the error report, I found that subasgn.m, part of the current NN Toolbox which carries out commands such as that last line, is now designed to ask [string].m - in this case trainpso.m - what the default settings are. However, that request was not made with that terminology in version 6.0.4, so it results in an error.
How might I edit the script so as to command Matlab to run it in the NN Toolbox 6.0.4 manner?


Johanna Pingel
Johanna Pingel 2019년 2월 6일
Here are the release notes for Deep Learning Toolbox (formerly Neural Network Toolbox):
New network creation functions have clearer names, no longer need example data, and have argument lists reduced to only the arguments recommended for most applications. All arguments have defaults, so you can create simple networks by calling network functions without any arguments. New networks are also more memory efficient, as they no longer need to store sample input and target data for proper configuration of input and output processing settings.
% New function
net = feedforwardnet(hiddenSizes, trainingFcn)
% Old function
net = newff(x,t,hiddenSizes, transferFcns, trainingFcn, ...
learningFcn, performanceFcn, inputProcessingFcns, ...
outputProcessingFcns, dataDivisionFcn)
The new functions (and the old functions they replace) are:
competlayer (newc)
distdelaynet (newdtdnn)
elmannet (newelm)
fitnet (newfit)
layrecnet (newlrn)
linearlayer (newlin)
lvqnet (newlvq)
narxnet (newnarx, newnarxsp)
patternnet (newpr)
perceptron (newp)
selforgmap (newsom)
timedelaynet (newtdnn)
The network's inputs and outputs are created with size zero, then configured for data when train is called or by optionally calling the new function configure.

Community Treasure Hunt

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

Start Hunting!

Translated by