From: Balwinder Singh on 20 Nov 2009 11:11 Hi all, I am working with newff neural network function to design a network. To get more familiar with the newff, I performed some tests with a function. Following is the function, I am using for testing: [code] x=-2:.2:2; y=-2:.2:2; [X,Y]=meshgrid(x,y); Z=X.*exp(-X.*X-Y.*Y); % preparing input for network design: xinp(:,1)= reshape(X,length(x)*length(y),1); xinp(:,2)= reshape(Y,length(x)*length(y),1); zinp = reshape(Z,length(x)*length(y),1); [/code] I am using the following parameters for newff: Number of layers: 2 (1 hidden and 1 output) Number of neurons: 10 in first layer and 1 in second The newff call looks like the following: [code] net=newff(minmax(xinp') ,[10 ,1],{'tansig','purelin'}); net.trainParam.epochs = 2000; net = train(net,xinp',zinp'); %generate test data x=-2:.1:2; y=-2:.1:2; [X,Y]=meshgrid(x,y); xinp1(:,1)= reshape(X,length(x)*length(y),1); xinp1(:,2)= reshape(Y,length(x)*length(y),1); TI=sim(net,xinp1'); [/code] The network successfully predicts the target values for the test data and the output looks reasonable. Now if I multiply Z by a big number , say 10,000, then the network doesn't perform that well. When I multiply Z by 10,000 and divide the whole Z matrix by max(max(Z)), the results look slightly better and convergence is also better. Does that mean that we have to normalize the input target vector if the values of target vector are too high? What is the best way to normalize the input target vector? Thanks!
|
Pages: 1 Prev: Rotating a rose plot Next: Matlab c++ compiled dll: problem mxarray double dim |