Neural Network Toolbox - Determine the range of outputs

Hello,
I am currently playing around with the Neural Net Toolbox of matlab. I just wonder how it is possible to determine the range of outputs with it. For example I put some inputs in it (normalized within -1 to 1) and would like to have outputs like "0" or "1" (or 2 instead of 2.5556). I tried it with targets just being 0/1 but simulation gave me values like "0.8994".
Is there a possibility doing this with nntool?
Kindest regards and thank you, Stefan

 Accepted Answer

Train and validate as usual using tansig or logsig for output activation units.
However, in the test and operational modes, use ROUND, as suggested by Walter.
Hope this helps.
Greg

2 Comments

Hello Greg,
thanks for your help. I also thought about rounding the outputs, but thought that it might be possible to somehow force the neural net to decide for determined output values like "yes" or "no".
Thanks again and kindest regards,
Stefan
For classification among c classes, the targets should be columns of the c-dimensional unit matrix eye(c). Although correct and incorrect classes are indicated by zeros and ones, using ROUND is not guaranteed to choose the correct class wnen c > 2.
For example, consider the output y = [0.45; 0.35; 0.2]. Although the posterior probability estimates sum to 1, the assigned class is obtained using MAX, not ROUND.
Hope this helps.
Greg

Sign in to comment.

More Answers (0)

Categories

Find more on Deep Learning Toolbox in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!