Art. Neural Network (ANN): How to get a binary output response
조회 수: 3 (최근 30일)
이전 댓글 표시
Hello,
my questions concerns the use of the ANN via: 'output = net(x)'. In my case I use a pattern net with binary outputs (1,0). Thus my network gives me (correct) output probabilities between 0 and 1. But I want to have direct decisions of the network, wether the output is 1 or 0. Is this possible?
I know that I can do that myself using a simple threshold function (e.g.: … if output > 0.5…) or using more complex algorithms afterwards, but I think there should be a way to get this directly, doesn't it?
Thank you for your help!
댓글 수: 0
채택된 답변
Greg Heath
2011년 11월 26일
If you have c classes/categories and the targets are the columns of the c-dimensional unit matrix, then the outputs are estimates of the input conditional posterior probabilities for each class.
The input is assigned to the class corresponding to the maximum output regardless of the type of activation function when one of the following are used:
softmax: 0 < P(i=c|x) < 1, sum(i=1:c){P(i=c|x)} = 1
logsig: 0 < P(i=c|x) < 1
purelin: sum(i=1:c){P(i=c|x)} = 1
Typically, the most important goal is correct classification and not necessarily the best estimate of the posteriors.
Use softmax if the best posterior estimates are desired. Otherwise use logsig and normalize to a unity sum after training. Since the estimates using purelin can be negative and/or exceed unity, you can dream up a number of ways to make them look appealing. But why bother when you can just as easily use the other functions?
Hope this helps.
Greg
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Sequence and Numeric Feature Data Workflows에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!