Pattern Recognition with single input and single output when Rule defined by sign of a Quadratic function

2 views (last 30 days)
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??

Answers (1)

Greg Heath
Greg Heath on 28 Jul 2015
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
R L
R L on 28 Jul 2015
Thank you for your answer. I thought to provide you with the data (see attached workspace file). Maybe you may have suggestion on how to get a perfect classification. Thanks

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!