LFD Book Forum PLA computing speed

#11
04-09-2013, 07:28 AM
 jlaurentum Member Join Date: Apr 2013 Location: Venezuela Posts: 41
Re: PLA computing speed

Got it. for the inner product (in R) I was using sum(w*x). I changed that to w%*%x and the speed changed DRAMATICALLY. Misterios arcanos del R!
#12
04-09-2013, 07:40 AM
 chiraz Member Join Date: Apr 2013 Location: Tunis, Tunisia Posts: 12
Re: PLA computing speed

Quote:
 Originally Posted by Elroch Good point about sapply! In answer to your question, I have observed empirically that the way you choose the misclassified point has quite a large effect on the convergence. As an attempt to improve on randomisation, one could certainly attempt to use the information in the value of w.x when sign(w.x) is wrong. But should we prefer large modulus of w.x or small?
About choice of misclassified point, the homework specifically asks to choose it arbitrarily. Aside from that, I'm not sure if a more informed choice would lead to faster convergence..
#13
04-09-2013, 07:48 AM
 chiraz Member Join Date: Apr 2013 Location: Tunis, Tunisia Posts: 12
Re: PLA computing speed

I also want to add that I am using Matlab and the whole experiment always takes only a few seconds (both for N=10 and N=100).
#14
04-09-2013, 08:09 AM
 Elroch Invited Guest Join Date: Mar 2013 Posts: 143
Re: PLA computing speed

Quote:
 Originally Posted by jlaurentum Got it. for the inner product (in R) I was using sum(w*x). I changed that to w%*%x and the speed changed DRAMATICALLY. Misterios arcanos del R!
This is curious. I have found in benchmark tests that with 3 dimensional vectors w and x, the times for sum(w*x) and w%*%x are indistinguishable. Could you post a fragment of test code where you can detect a significant difference?

[chiraz, yes, it should be noted that attempts to improve convergence are a separate matter from the homework]
#15
04-09-2013, 08:26 AM
 IsidroHidalgo Member Join Date: Apr 2013 Location: Toledo (Spain) Posts: 28
Re: PLA computing speed

I select randomly a missclassified point, but I don't think that this improves speed so much, but the use of inner product maybe (using 10000 points to calculate the probability of error between f(x) and g(x) can lead to important improvement)
#16
04-09-2013, 11:23 AM
 brian.holt Junior Member Join Date: Mar 2013 Location: Seattle Posts: 1
Re: PLA computing speed

I'm glad to hear it took some time for your iterations. I got to a point where I thought my code wasn't working, so I kept stopping it. Needless to say, my scores on the last 3 questions reflected my lack of confidence in my code.
#17
04-09-2013, 06:46 PM
 clarkfitzg Junior Member Join Date: Apr 2013 Posts: 6
Re: PLA computing speed

Choosing a random misclassified point versus the first misclassified point made a significant difference for me when N = 100.

 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 09:01 AM.