LFD Book Forum PLA - Need Guidance
 User Name Remember Me? Password
 FAQ Calendar Mark Forums Read

 Thread Tools Display Modes
#21
01-16-2013, 05:00 AM
 iamtrk Junior Member Join Date: Jan 2013 Posts: 8
Re: PLA - Need Guidance

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
01-16-2013, 05:40 AM
 alternate Member Join Date: Jan 2013 Posts: 14
Re: PLA - Need Guidance

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
01-16-2013, 09:14 PM
 iamtrk Junior Member Join Date: Jan 2013 Posts: 8
Re: PLA - Need Guidance

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
01-17-2013, 03:57 AM
 alternate Member Join Date: Jan 2013 Posts: 14
Re: PLA - Need Guidance

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
04-06-2013, 04:54 PM
 mvellon Junior Member Join Date: Apr 2013 Posts: 9
Re: PLA - Need Guidance

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
04-06-2013, 07:31 PM
 yaser Caltech Join Date: Aug 2009 Location: Pasadena, California, USA Posts: 1,477
Re: PLA - Need Guidance

Quote:
 Originally Posted by mvellon 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)
You are correct, and the result is that will always be an integer under this scheme. However, if the entire vector is scaled up or down, the separating line it represents does not change, so the you get is equivalent to other 's in which is not an integer.
__________________
Where everyone thinks alike, no one thinks very much

 Tags convergence, iterations, perceptron, pla

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home General     General Discussion of Machine Learning     Free Additional Material         Dynamic e-Chapters         Dynamic e-Appendices Course Discussions     Online LFD course         General comments on the course         Homework 1         Homework 2         Homework 3         Homework 4         Homework 5         Homework 6         Homework 7         Homework 8         The Final         Create New Homework Problems Book Feedback - Learning From Data     General comments on the book     Chapter 1 - The Learning Problem     Chapter 2 - Training versus Testing     Chapter 3 - The Linear Model     Chapter 4 - Overfitting     Chapter 5 - Three Learning Principles     e-Chapter 6 - Similarity Based Methods     e-Chapter 7 - Neural Networks     e-Chapter 8 - Support Vector Machines     e-Chapter 9 - Learning Aides     Appendix and Notation     e-Appendices

All times are GMT -7. The time now is 08:18 PM.

 Contact Us - LFD Book - Top

Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
The contents of this forum are to be used ONLY by readers of the Learning From Data book by Yaser S. Abu-Mostafa, Malik Magdon-Ismail, and Hsuan-Tien Lin, and participants in the Learning From Data MOOC by Yaser S. Abu-Mostafa. No part of these contents is to be communicated or made accessible to ANY other person or entity.