I am facing an issue using the NEWFF function when creating a feed-forward network using the LOGSIG functions for output neurons. The output of the network is in the range of [0.5 1] even though I expect it to be in the range of [0 1] for the target [0 1]. However this behavior is not observed by the use of a different function like TANSIG.
The code below provides you with the same.
2) Reproduction steps:
clear;p = [-1 -1 2 2; 0 5 0 5];t = [0 0 1 1];% current interface
net = newff(p, t, 3, {'logsig','logsig'});net.divideFcn = '';net.trainParam.show = 50;net.trainParam.lr = 0.05;net.trainParam.epochs = 300;net.trainParam.goal = 1e-5;[net, tr, Y, E ] = train(net,p,t);y = sim(net, p);%%OUTPUT
% >> y
% y =
% 0.5000 0.5000 1.0000 1.0000
However, if I use output processing function MAPMINMAX the same code gives a different answer.
clear;p = [-1 -1 2 2; 0 5 0 5];t = [0 0 1 1];minmaxP = minmax( p );% minmaxP =
% -1 2
% 0 5
numOutputs = size(t, 1);% depreciated interface
net = newff(minmaxP, [3, numOutputs], {'logsig','logsig'});net.divideFcn = '';net.trainParam.show = 50;net.trainParam.lr = 0.05;net.trainParam.epochs = 300;net.trainParam.goal = 1e-5;[net, tr, Y, E ] = train(net,p,t);y = sim(net, p);%%OUTPUT% >> y% y =% 0.0001 0.0001 0.9999 0.9946
Please explain the reason for difference in the output.
Best Answer