LFD Book Forum  

Go Back   LFD Book Forum > Course Discussions > Online LFD course > Homework 1

Reply
 
Thread Tools Display Modes
  #11  
Old 04-09-2013, 08:28 AM
jlaurentum jlaurentum is offline
Member
 
Join Date: Apr 2013
Location: Venezuela
Posts: 41
Default 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!
Reply With Quote
  #12  
Old 04-09-2013, 08:40 AM
chiraz chiraz is offline
Member
 
Join Date: Apr 2013
Location: Tunis, Tunisia
Posts: 12
Default Re: PLA computing speed

Quote:
Originally Posted by Elroch View Post
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..
Reply With Quote
  #13  
Old 04-09-2013, 08:48 AM
chiraz chiraz is offline
Member
 
Join Date: Apr 2013
Location: Tunis, Tunisia
Posts: 12
Default 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).
Reply With Quote
  #14  
Old 04-09-2013, 09:09 AM
Elroch Elroch is offline
Invited Guest
 
Join Date: Mar 2013
Posts: 143
Default Re: PLA computing speed

Quote:
Originally Posted by jlaurentum View Post
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]
Reply With Quote
  #15  
Old 04-09-2013, 09:26 AM
IsidroHidalgo IsidroHidalgo is offline
Member
 
Join Date: Apr 2013
Location: Toledo (Spain)
Posts: 28
Default 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)
Reply With Quote
  #16  
Old 04-09-2013, 12:23 PM
brian.holt brian.holt is offline
Junior Member
 
Join Date: Mar 2013
Location: Seattle
Posts: 1
Default 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.
Reply With Quote
  #17  
Old 04-09-2013, 07:46 PM
clarkfitzg clarkfitzg is offline
Junior Member
 
Join Date: Apr 2013
Posts: 6
Default Re: PLA computing speed

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

Check this thread.
Reply With Quote
Reply

Thread Tools
Display Modes

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 Jump


All times are GMT -7. The time now is 04:16 AM.


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.