Output of feedfoward neural network problem.
조회 수: 4 (최근 30일)
이전 댓글 표시
Hi everyone,
I work with the feedfoward neural network model of the toolbox neural network of matlab. I need to change the activation function the output layer by a logsig function insteed of the purelin function.
I write the following code:
NET = feedforwardnet(nbHidden);
NET.layers{2}.transferFcn = 'logsig'; % Change the activation function of the output layer by the 'logsig' function.
[NET,TR] = train(NET,Xtrain,Ytrain); % Ytrain equal to zero or one
And then I apply a test with four input and the expected output is [ 1 0 0 1 ]. But I get: [ 1 0.5 0.5 1 ]. In a more complex test, I have the same problem, the output min value is 0.5 and not 0. Did I miss something in the modification of the activation function?
Remark:
NET.outputs{2}.range
give
[ 0 1 ]
댓글 수: 0
답변 (2개)
Pooja Sethia
2018년 2월 13일
Output of the neural network is the conditional posterior probability of the input. 'logsig' function gives 0< P(i = class| x) < 1. Therefore to get the binary output you need to normalize the probablities to unity sum after training.
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!