From: <mic...@us...> - 2009-09-30 17:55:00
|
Revision: 6284 http://octave.svn.sourceforge.net/octave/?rev=6284&view=rev Author: michaelschmid Date: 2009-09-30 17:54:51 +0000 (Wed, 30 Sep 2009) Log Message: ----------- removed a bug in newff.m modified inst/newff.m Modified Paths: -------------- trunk/octave-forge/main/nnet/inst/newff.m Modified: trunk/octave-forge/main/nnet/inst/newff.m =================================================================== --- trunk/octave-forge/main/nnet/inst/newff.m 2009-09-30 11:16:48 UTC (rev 6283) +++ trunk/octave-forge/main/nnet/inst/newff.m 2009-09-30 17:54:51 UTC (rev 6284) @@ -64,9 +64,20 @@ ## check range of input arguments error(nargchk(2,6,nargin)) + ## get number of layers (without input layer) + nLayers = length(ss); + ## set defaults if (nargin <3) - transFunc={"tansig"}; + # the number of transfer functions depends on the number of + # hidden layers, so we have to create a loop here 30.09.09 (dd.mm.yy) + for i=1:nLayers + if (i==nLayers) + transFunc{i,1} = "purelin"; + else + transFunc{i,1}= "tansig"; + endif + endfor endif if (nargin <4) trainFunc = "trainlm"; @@ -86,9 +97,6 @@ ## check input args checkInputArgs(Pr,ss); - ## get number of layers (without input layer) - nLayers = length(ss); - ## Standard architecture of neural network net = __newnetwork(1,nLayers,1,"newff"); ## description: @@ -98,7 +106,6 @@ ## third argument: number of outputs, nothing else allowed till now ## it's not the same like the number of neurons in this output - ## set inputs with limit of only ONE input net.inputs{1}.range = Pr; [nRows, nColumns] = size(Pr); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |