Thread: Help request for Question 7 View Single Post
#1
03-30-2017, 09:23 AM
 Butterburshen Junior Member Join Date: Mar 2017 Posts: 1
Help request for Question 7

Added: 31st March 2017 - I have started a new day with new energy and realise that I now I have an example I just need to step through and figure it out. I have gradually reduced the dataset item -0.9421858,-0.2774195 to -0.94,-0.27 and still have the problem but can now see that I have 1 + 0.06 = 0.0600000023841858 so there is definitely something odd going on - I suspect my choice of datatype as Double was not appropriate. At least I now have ways forward - hope this hasn't wasted anyone's time.

***** original post was as follows:

Have been working on question 7 for quite a few days on and off and think it is working about 80% of the time but the rest of the time it doesn't converge. The convergence rate when it happens is consistent with the answer to question 7 (generally a bit lower). I don't want to give up or just move on but am running out of ideas. I saw an item from someone using R but don't think it is relevant to my coding (vb.Net). Have captured a set of points and target function that give the non-convergence for me and wondered whether the pattern that is developing in the output might mean something to someone and that they might be able to nudge me in the right direction as to the type of error that might cause this. I started with hypothesis 1,1,1 rather than 0,0,0 as found that easier to understand and book says that it should still converge.
My log output is as follows:
*** New target Function y = -1.70501758822182 x + -2.02219342623774
*** New target Function w2,w1,w0 1,1.70501758822182,2.02219342623774
--- these are the testpoints that are plotted
*** New target Function True item y,x -0.5208916,0.9359545
*** New target Function True item y,x 0.651186,0.4874589
*** New target Function True item y,x 0.3568661,0.8375128
*** New target Function True item y,x -0.1229761,-0.5325124
*** New target Function False item y,x -0.7617609,-0.8176664
*** New target Function True item y,x 0.9182641,0.2827711
*** New target Function True item y,x -0.9421858,-0.2774195
*** New target Function True item y,x 0.07790287,-0.9579112
*** New target Function True item y,x 0.4299951,-0.2968374
*** New target Function True item y,x -0.3834649,-0.1510788
*** New target Function Dataset items Total True 9 Total False1
--- these pairs of lines of output show the hypothesis w2,w1,w0 and then the point y,x,+or-1 that will be added to it on the first line and the result(new hypothesis) on the second of the pair --
LEARN - Hypoth before 1,1,1 testpoint -0.9421858,-0.2774195,+1
LEARN - Hypoth after 0.0578141808509827,0.72258049249649,2
LEARN - Hypoth before 0.0578141808509827,0.72258049249649,2 testpoint -0.7617609,-0.8176664,-1
LEARN - Hypoth after 0.819575071334839,1.54024690389633,1
LEARN - Hypoth before 0.819575071334839,1.54024690389633,1 testpoint -0.9421858,-0.2774195,+1
LEARN - Hypoth after -0.122610747814178,1.26282739639282,2
---- from here onwards it just keeps adding the same point over and over
LEARN - Hypoth before -0.122610747814178,1.26282739639282,2 testpoint -0.5208916,0.9359545,+1
LEARN - Hypoth after -0.643502354621887,2.19878190755844,3
LEARN - Hypoth before -0.643502354621887,2.19878190755844,3 testpoint -0.5208916,0.9359545,+1
LEARN - Hypoth after -1.1643939614296,3.13473641872406,4
LEARN - Hypoth before -1.1643939614296,3.13473641872406,4 testpoint -0.5208916,0.9359545,+1
LEARN - Hypoth after -1.6852855682373,4.07069092988968,5
LEARN - Hypoth before -1.6852855682373,4.07069092988968,5 testpoint -0.5208916,0.9359545,+1
LEARN - Hypoth after -2.20617717504501,5.0066454410553,6
LEARN - Hypoth before -2.20617717504501,5.0066454410553,6 testpoint -0.5208916,0.9359545,+1
LEARN - Hypoth after -2.72706878185272,5.94259995222092,7
LEARN - Hypoth before -2.72706878185272,5.94259995222092,7 testpoint -0.5208916,0.9359545,+1
LEARN - Hypoth after -3.24796038866043,6.87855446338654,8
LEARN - Hypoth before -3.24796038866043,6.87855446338654,8 testpoint -0.5208916,0.9359545,+1
LEARN - Hypoth after -3.76885199546814,7.81450897455215,9
LEARN - Hypoth before -3.76885199546814,7.81450897455215,9 testpoint -0.5208916,0.9359545,+1
etc etc as it keeps using the same point.

On the graphic the hypothesis line is seen to move from being nearly right (just -0.9421858,-0.2774195 is under the hypothesis instead of above) to, after 1200 cycles, all points being below the hypothesis ( all the points wrong except for one).