NEURAL NETWORK-SIGMOID FUNCTION
8 views (last 30 days)
Show older comments
I am working on using Artificial Neural Network for prediction.
My expected_Targets have values between 0 and 1.
The trained Neural_Target has sometimes -0.234 and 1.567 .
Therefore, I want the trained Neural_Target to be in the range of 0 and 1. That is, any number less than 0.5 should be 0 and numbers above 0.5 should be 1.
I know I am to use "logsig" but I could not figure it well using MATLAB documentation.
Thanks in advance for your help
NEURAL NETWORK-SIGMOID FUNCTION. Available from: https://www.researchgate.net/post/NEURAL_NETWORK-SIGMOID_FUNCTION [accessed Jul 26, 2017].
0 Comments
Answers (3)
Greg Heath
on 26 Jul 2017
Edited: Greg Heath
on 28 Jul 2017
Apparently
1. You are using the term prediction when you
mean classification
2. You are using the term targets when
you mean outputs. Targets are desired outputs.
You did not state
3. The network design function. Patternnet
is the appropriate function for classification.
4. Any non-default patternnet input values. Use
the help and doc commands for the
description of patternnet and it's default
inputs.
5. The hidden and output layer transfer functions
are obtained from
>> hidlaytransfcn = net.layers{1}.transferFcn
hidlaytransfcn = 'tansig'
>> outlaytransfcn = net.layers{2}.transferFcn
outlaytransfcn = 'tansig'
which yields outputs in the open range (-1,1)
This is because patternnet (and other training functions) AUTOMATICALLY transform inputs and targets to the closed interval [-1, 1]. Then reverses the transformation upon output.
Therefore, if you use patternnet, all you have to do is input your 0/1 targets and let patternnet do its job!
Hope this helps.
Thank you for formally accepting my answer
Greg
3 Comments
Greg Heath
on 27 Jul 2017
I am sorry I did not make my self more clear.
PATTERNNET is a special case of FEEDFORWARDNET that is designed for classification of 0/1 targets.
See my QUICKIE code for starters
Then searching the NEWSGROUP and ANSWERS using
greg patternnet
should help more.
Hope this helps.
If it does,
Thank you for formally accepting my original answer
Greg
Greg Heath
on 28 Jul 2017
Edited: Greg Heath
on 28 Jul 2017
I just posted a followup to QUICKIES
https://www.mathworks.com/matlabcentral/newsreader/view_thread/349202
The zeros and ones are the result of
vec2ind ( y ) ~= vec2ind( t )
Hope this helps.
Thank you for formally accepting my answer
Greg
0 Comments
See Also
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!