Path: news.mathworks.com!not-for-mail From: "Greg Heath" <heath@alumni.brown.edu> Newsgroups: comp.soft-sys.matlab Subject: Re: patternnet vs newff Date: Thu, 20 Dec 2012 06:46:17 +0000 (UTC) Organization: The MathWorks, Inc. Lines: 62 Message-ID: <kauc7p$30a$1@newscl01ah.mathworks.com> References: <kammao$48q$1@newscl01ah.mathworks.com> Reply-To: "Greg Heath" <heath@alumni.brown.edu> NNTP-Posting-Host: www-00-blr.mathworks.com Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: newscl01ah.mathworks.com 1355985977 3082 172.30.248.45 (20 Dec 2012 06:46:17 GMT) X-Complaints-To: news@mathworks.com NNTP-Posting-Date: Thu, 20 Dec 2012 06:46:17 +0000 (UTC) X-Newsreader: MATLAB Central Newsreader 2929937 Xref: news.mathworks.com comp.soft-sys.matlab:785115 "Barbara" wrote in message <kammao$48q$1@newscl01ah.mathworks.com>... > Hi > I am trying to update some of my MATLAB scripts accordimg to the new nnet-Toolbox functions, but I cannot get some things to work. For example: > old version: -----SNIP > f = 'logsig'; > net = newff(minmax(p),[2,1],{f,f}); > net.IW{1,1}= [0.2 0.2; 0.2 0.2]; > net.LW{2,1}=[0.2 0.2]; > net.b{1,1} = [0 ;0]; > net.b{2,1} = 0; > net(p) > ans = 0.5498 0.5548 0.5548 0.5596 > > new version > net = patternnet([2]); > net.layers{2}.transferFcn = f; > net.layers{1}.transferFcn = f; > net = configure(net,p,t); > net.IW{1,1}= [0.2 0.2; 0.2 0.2]; > net.LW{2,1}=[0.2 0.2]; > net.b{1,1} = [0 ;0]; > net.b{2,1} = 0; > net(p) > ans = > 0.7700 0.7749 0.7749 0.7798 > The outputs of these two nets, which I thought should be identical are different. I do understand the output of the newff-net, but I don't see how it comes to the results in case of patternnet. > > Any help would be very much appreciated %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% There are 3 generations of the NNTBX to consider. Each has different defaults that can be deduced, with pain, with the assistance of the commands help, doc and type RC = Regression and Curvefitting CP = Classification and Pattern Recognition 1. net1 =newff(minmax(p), [H O], TF*, BTF, BLF, PF ) % RC and CP => 'tansig' output/No IPF, OPF, or DDF 2. a. net2 =newff(p, t, H, TF*, BTF, BLF, PF, IPF*, OPF*, DDF*) % RC and CP ==> 'purelin' output/IPF, OPF and DDF defaults b. net3 =newfit(p, t, H, TF, BTF, BLF, PF, IPF, OPF, DDF) % RC (calls newff) ==> same as newff with an added plot c. net4 =newpr(p, t, H, TF*, BTF, BLF, PF, IPF, OPF, DDF) % CP (calls newff) ==>same as newff with 'tansig' output, 'trainscg' training and added CP plots 3. a. net5 =feedforwardnet( H, TF ) % RC and CP b. net6 =fitnet( H, TF ) % RC (calls feedforwardnet) ==> same as feedfordnet with an added plot c. net7 =patternnet( H, TF ) % CP (calls newff) ==>same as newff with 'tansig' output, 'trainscg' training and added CP plots 1. Instead of trying to compare net1 and net7, it is probably best to start with finding the differences among net1, net2 and net5. 2. Nets 2-7 have input and output normalization via MAPMINMAX defaults that results in changes in weight values. So, I don't think just assigning the same weights to the different nets will help. 3. The actual normalizations are probably performed in TRAIN. So it might be wise to override the IPF and OPF defaults and use TRAIN. 4. If TRAIN is used the DDF option should be overridden to make sure all of the data is used for training. Please post any partial successes in understanding. Greg