Neural network doesn't return values below 0.5 with logsig

白昼怎懂夜的黑 提交于 2019-12-24 12:35:13

问题


I want to classify two classes with a neural network. Since outputs are 0 or 1, I am using (or trying t use) 'logsig' for the output function. My problem is that when I do that, my simulations end up being between 0.5 and 1. As if everything entering the logsig function was positive.

PS: My training set and my testing set are composed of normalized values.

Here is what I do:

t = [0.8*ones(1,50) 0.2*ones(1,50)];
%define net
net = newff(trainSet,t,n,{'tansig','logsig'},'trainscg');
net.trainparam.epochs = 100;
net.trainParam.goal = 0;
%train net
net = train(net,trainSet,t);
%test net
%%on testing set
outputs = sim(net,testSet)

来源:https://stackoverflow.com/questions/22216608/neural-network-doesnt-return-values-below-0-5-with-logsig

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!