Neural network doesn't return values below 0.5

2019-08-03 15:55发布

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)

0条回答
登录 后发表回答