Pattern Recognition with single input and single output when Rule defined by sign of a Quadratic function
Show older comments
I am new to this field of pattern recognition. I have my input x that takes values [-10,10], I have also defined my target to be 0 if x takes either a negative value or a value superior to 1, and my target is 1 if x is in [0,1]. the rule is well defined as the sign of -x(x-1) . I was expecting that running nprtool I will find a perfect pattern. I am not getting anything closer to perfect pattern. I have then added hidden multilayers through via : net=patternnet([10 5]); and I have also used different transfer function, but I am not getting a good pattern.
This is a case of 'Quadratic SEPERABLE RULE' by definition and I am expecting that neural network ought to solve for it perfectly. What am I doing wrong??
1 Comment
Walter Roberson
on 27 Jul 2015
The sign of -x*(x-1) perhaps?
Answers (1)
Greg Heath
on 28 Jul 2015
0 votes
1. If you plot the target t = sign(x.*(1-x)). You will see that you need very closely spaced points only near the discontinuities at x = 0 and x = 1. Therefore the most efficient x spacing will not be uniform.
2. However, do not be afraid to use a lot of uniformly spaced points for preliminary designs.
3. Since this is a function-fitting task, use FITNET.
4. If you look at the plot cross-eyed, you will see a single-humped blur which cannot be modeled well with less than 3 hidden nodes.
5. However do not be afraid to use the default H =10 for preliminary designs.
6. The success of a design will depend on the luck of obtaining good random initial weights and trn/val/tst data division.
7. However, for preliminary designs do not be afraid to use DIVIDETRAIN ( Ntst = Nval = 0) or even DIVIDEINT with Ntst = Nval = Ntrn.
8. If you search for my posts on FITNET you will see double loop designs with the outer loop over a range of numH hidden node candidates (e.g., h = 3:10, numH = 8) and the inner loop over Ntrials = 1:10 random generator states to obtain multiple sets of random initial weights for each value of h.
9. If you save the state of the random number generator at the beginning of the inner loop , you will be able to recreate any of the numH*Ntrials designs.
10. For a given performance, the designs with the fewest number of hidden nodes are the most desirable.
Hope this helps.
Thank you for formally accepting this answer
Greg
3 Comments
Greg Heath
on 28 Jul 2015
WHOOPS! I approached this as a function-fitting problem instead of a classification problem with PATTERNNET.
If you need to practice with more realistic classification data, check out the MATLAB classification and clustering examples by using the commands
help nndatasets
doc nndatasets
R L
on 28 Jul 2015
Greg Heath
on 30 Jul 2015
I can comment on your posted solution if you convert your posted data to *.m or *.txt
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!