# What am I doing wrong with hw5.3?

 14 1 I wont place my code, but I basically just took over what was shown in the video for hw5-3. Funnily enough I get: [[0, 0], [5.1257557637014316e+307, 3.6054863890688511e+306], [2.3213664369024311e+307, 1.6328626407199667e+306], [6.7824048353802897e+305, 4.7707829596773796e+304], [-2.235757895364848e+307, -1.5726450954407239e+306], [-5.2222802968343177e+307, -3.673382306976488e+306], [6, 0], [8.9205188647975054e+307, 6.27474480580988e+306], [8.8580231942965764e+307, 6.2307849880222052e+306], [6, 3], [-5.2032199824328205e+307, -3.6599751710659726e+306], [-2.3564486463998559e+307, -1.6575396710368467e+306], [-6.8849055672202959e+305, -4.8428825966235518e+304], [2.2695463250431335e+307, 1.596412072914244e+306], [5.3012032656660389e+307, 3.7288971814432291e+306], [0, 3], [-9.0553323547470735e+307, -6.3695733972873715e+306], [nan, -6.3249492261720942e+306]]  I have tried to vary the style a bit to get different results, but I keep getting similar issues. If I just check Thrun's formula I think there is nothing wrong with it, but a direct implementation seem to be not working. Anyone that has seen something similar or just has a general tip for what I am doing wrong? asked 20 Mar '12, 12:22 Ben Haanstra 500●3●4●17 accept rate: 50% Gundega ♦♦ 44.0k●70●170●315 Could you format your output please? Select your output and hit the 1010 button. (20 Mar '12, 12:38) yoshi 6 Alright, I see what I missed there. Tip for the next person: look in the notes for the word: AND. D'oh! (20 Mar '12, 13:23) Ben Haanstra Just a clarification needed - when Prof says 'points like these' did he mean points either side of the fixed points? He speaks faster at times and I am listening it repeatedly but he remains elusive ;) (20 Mar '12, 16:57) rakesh kumar 1 No, rukacity, he means ALL non-fixed points. I admit, at first it was a little confusing. (24 Mar '12, 17:01) Gibgezr

 17 Read the comments on top of the code, they say apply ... and the formulas presented in the video. Also consider http://www.udacity-forums.com/cs373/questions/24337/homework-5-3-update-formulas answered 20 Mar '12, 12:35 Ruslan Ciurca 2.9k●7●21●25 Thanks!! I didn't read it carefully. That was precisely the problem. I hate when I do this :) (20 Mar '12, 12:41) Guillermo Go... 1 Lol, Ruslan, you saved me again! Minus one for me for lack of reading skills. To the original person who wrote the question: I got similar numbers until I read the line "# You will need to use ..." and followed those instructions carefully. (20 Mar '12, 12:54) Steve Carlin-1 Do we need to use the equations from gradient descent for fixed points also? And I understand from other thread that new equations doesn't apply for fixed points. Is both those statements correct? (20 Mar '12, 13:30) Balaji Sunda... Sebatian implements that in his code as well with if fix[i]==0  (24 Mar '12, 12:58) yoshi
 2 Answer is to look in the notes of the program itself. answered 20 Mar '12, 13:25 Ben Haanstra 500●3●4●17
 2 So can somebody explain why halving the factor (smoothing weight) makes such a huge difference? I know that a gradient descent can wildly oscillate if the descent factor is large, where it keeps missing the local minima and climbing up - is this what's happening here? If that's the case, it shouldn't converge - but it manages to converge with such large values. answered 20 Mar '12, 22:25 Max Mir 424●5●10●18 1 Because since the updates are not happening simultaneously, you end up minimising a different function for each different weight parameter (21 Mar '12, 02:06) Alejandro Du...
 0 I've got a similar problem. My error starts decreasing but, when it reaches around 0.33 it starts to diverge. I've actually plotted the results and it looks like the cornering moving points are being pulled away more or less as you would expect but the points at x=3 are not moving away. So, instead of looking like an oval it appears to be converting to a horizontal "8" so to speak. Beyond that point, everything starts to get crazy and error goes to "infinity and beyond". I've watched the video quite a few times and I just don't get what I may have overlooked. It looks like a simple change in the formulas when updating the non-fixed points but it is not reaching a solution. Any idea what could cause it to diverge? answered 20 Mar '12, 12:32 Guillermo Go... 301●2●13 You have the formulas wrong! Check all the signs carefully and check that you are using the right beta. Many times in my testing, it would diverge and never stop when I had the formulas wrong. When you have them correct, it converges. (20 Mar '12, 19:29) Curt Welch
 0 Could anyone explain why in hw5-3 we need to compare the sum of change in both coordinate deviations with the tolerance, but in hw5-2 we do not answered 21 Mar '12, 13:05 Anh Nguyen 331●7 I believe, this is the private case. In hw5-3 we added smoothing around the fixed points and the deviation of y coordinate of the path last point became an inappropriate convergence criterion (less iterations, insufficient smoothing). Therefore, the sum of coordinate errors (but for the last point i=17 as before) has been chosen. And because we have to match the test, we should use the same criterion in our code :) I think there are many ways to improve the code for the real life :) (22 Mar '12, 07:03) Sergey Radzh... I suppose that we do this in hw5-2 too. (23 Mar '12, 19:09) Svyatoslav Z...
 0 If you are getting huge numbers or nan values, make sure you ADDED the new code to the old code and didn't REPLACE the old code with the new code. answered 24 Mar '12, 17:00 Mikey 334●6●9 can u tell me the new equations which were given in class... the video didn't run completely in my comp due to .dll error.... (25 Mar '12, 01:14) vipul divyanshu
 0 I had exactly the same problem - took me a while to figure out what's wrong. It could have taken much less time if I read forums! answered 25 Mar '12, 13:10 Vitaly Lishc... 23●1
 0 Guys, I understand that we have to apply BOTH the new gradient descent AND the old equations, and I also understand that we ONLY APPLY THEM TO THE NON FIXED POINTS, but my question is: In what order do I apply the new gradient descent equations with the old ones? In that, in the old way, I have eq1, eq2 being done. Now new equations are eq3 and eq4. So we just apply eq1, eq2, eq3, eq4 in that order?? Thanks answered 25 Mar '12, 21:08 Terran 2.8k●24●47●69 1 Yes, in that order. But don't forget to update newpath after each equation and not just at the end. (25 Mar '12, 21:35) Mikey and take care of the weights. Prof does mention that the new euations need to split the weights so that they add to 1. (25 Mar '12, 22:24) rakesh kumar @rukacity ... the weights?... (25 Mar '12, 22:56) Terran
Question text:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "Title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported

### Tags:

×5,185
×69

Seen: 2,203 times

Last updated: 06 Apr '12, 13:41