![]() |
#21
|
|||
|
|||
![]()
Hi butterscotch,
Thanks for the tip now its converging consistently, but it is taking much lesser iterations , for 10 training points avg iterations are 1.5 and for 100 touchpoints it is around 10. These values are wrong according to the answer sheet.Can you help me with this. now i am using ax+by = c line equation. The bias term i am initiating it to the constant term of the line that i created initially from two random points. For misclassified points bias term is w = w+/- 1. Is this correct or still am i missing something. Thanks, Trk |
#22
|
|||
|
|||
![]()
Does your program print out the number of iterations and probability of error after every individual trial?
If not, you might want to add that so that you can watch it calculate and compare those numbers to the mean you get at the end. It will help narrow down whether the problem is in your algorithm or a simple math error. I.e., if you're getting 1.5 for the average iterations per trial, then most of your individual trials should have numbers like 1 or 2 iterations. |
#23
|
|||
|
|||
![]()
Hi all,
I did a little mistake in check for convergence , now i corrected it still its taking far lesser iterations to converge . I am checking how the final values seperate the trainig Points, it is matching perfectly . WHAT I THINK IS THAT I AM INITIATING W0 TO THE CONSTANT TERM OF THE ORIGINAL LINE so the algo is taking lesser iterations . But If i initiate it to 0. It is not converging. MY CONCERN IS IF W0 IS INITIATED TO 0. THEN IT IS NOT CONVERGING. SHOULD I INITIATE W0 WITH SOME RANDOM NUMBER . Fellow students please Help me here . I am stuck on this. |
#24
|
|||
|
|||
![]()
w0 is definitely supposed to be initialized to zero, so there's a logic error in your code somewhere. If whether or not you converge depends on the initial value, you're probably not actually updating w0. w0 should update every iteration.
It would be helpful if you can run a 1-trial test and manually examine the results of every iteration (see what the new weights are, how many points are currently misclassified.) This is really easy to do in the language I'm using but I'm not familiar with Java. You could probably print out the values or graph them visually. Either way, changing the trials from 1000 to 1 and stepping through the algorithm may show you an obvious source of error. Then once one trial gives you the results you're supposed to get, doing multiple trials should work out cleanly. If you still can't figure out what's going wrong, then you could post here the output of the program for one trial. |
#25
|
|||
|
|||
![]()
I think I've got the PLA working correctly, but I'm not sure that I can see how w0 ends up being anything other than 1, 0 or -1. Is this correct?
if w = w + xn*yn, but x0 always is 1 and yn is 1 or -1, then w0 is only ever going to change by 1 or -1. No? (Correction: w0 only ever changes by 1 or -1) Last edited by mvellon; 04-06-2013 at 05:28 PM. Reason: mistake |
#26
|
||||
|
||||
![]() Quote:
![]() ![]() ![]() ![]() ![]()
__________________
Where everyone thinks alike, no one thinks very much |
![]() |
Tags |
convergence, iterations, perceptron, pla |
Thread Tools | |
Display Modes | |
|
|