LFD Book Forum  

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

Reply
 
Thread Tools Display Modes
  #1  
Old 04-07-2012, 08:02 PM
tcristo tcristo is offline
Member
 
Join Date: Apr 2012
Posts: 23
Default Impact of Alpha on PLA Converging

Two of the questions (7 & 9) ask how many iterations it takes for the PLA to converge. I would expect this to be a function of both the size of N that was mandated as well as the alpha (learning rate) that is selected. Is this not correct?
Reply With Quote
  #2  
Old 04-07-2012, 08:18 PM
yaser's Avatar
yaser yaser is offline
Caltech
 
Join Date: Aug 2009
Location: Pasadena, California, USA
Posts: 1,477
Default Re: Impact of Alpha on PLA Converging

Quote:
Originally Posted by tcristo View Post
Two of the questions (7 & 9) ask how many iterations it takes for the PLA to converge. I would expect this to be a function of both the size of N that was mandated as well as the alpha (learning rate) that is selected. Is this not correct?
The PLA rule we use does not have a learning rate (or has a learning rate of 1 if you will). The size N indeed affects the number of iterations, and the homework questions specify particular values for N.
__________________
Where everyone thinks alike, no one thinks very much
Reply With Quote
  #3  
Old 04-07-2012, 08:32 PM
tcristo tcristo is offline
Member
 
Join Date: Apr 2012
Posts: 23
Default Re: Impact of Alpha on PLA Converging

Quote:
Originally Posted by yaser View Post
The PLA rule we use does not have a learning rate (or has a learning rate of 1 if you will). The size N indeed affects the number of iterations, and the homework questions specify particular values for N.
Thanks! I didn't realize that the learning rate wasn't present in the model you had discussed during the first lecture. I had previously run all my data at .5 so it will be interesting to see what the difference is when I set it to 1.
Reply With Quote
  #4  
Old 04-08-2012, 12:25 AM
htlin's Avatar
htlin htlin is offline
NTU
 
Join Date: Aug 2009
Location: Taipei, Taiwan
Posts: 601
Default Re: Impact of Alpha on PLA Converging

If you take a deeper look at the steps of the PLA algorithm, you'll find that setting the learning rate to any positive value gives you equivalent results (subject to the same random sequence and equivalent starting weights, of course). For instance, if you start with the zero vector, the final weights that you get for learning rate 1 are simply twice the final weights that you get for learning rate 0.5.
__________________
When one teaches, two learn.
Reply With Quote
  #5  
Old 04-08-2012, 08:32 AM
tcristo tcristo is offline
Member
 
Join Date: Apr 2012
Posts: 23
Default Re: Impact of Alpha on PLA Converging

Quote:
Originally Posted by htlin View Post
If you take a deeper look at the steps of the PLA algorithm, you'll find that setting the learning rate to any positive value gives you equivalent results (subject to the same random sequence and equivalent starting weights, of course). For instance, if you start with the zero vector, the final weights that you get for learning rate 1 are simply twice the final weights that you get for learning rate 0.5.
I agree. However, I wouldn't think that would necessarily result in halving the the number of iterations required to converge or result in the "best" answer.

I would expect that if your learning rate is too large it would be possible to "overshoot" the convergence values and therefore require some back and forth before they settle. Depending upon the extent of that oscillation it may or may not require more iterations than a smaller value.

I guess you could also say a similar thing about too small a learning value. It could slowly inch up to one possible set of convergence weight values and get stuck in a "local minima" of sorts without truly finding the "global minima".
Reply With Quote
  #6  
Old 04-08-2012, 09:45 AM
htlin's Avatar
htlin htlin is offline
NTU
 
Join Date: Aug 2009
Location: Taipei, Taiwan
Posts: 601
Default Re: Impact of Alpha on PLA Converging

Quote:
Originally Posted by tcristo View Post
I agree. However, I wouldn't think that would necessarily result in halving the the number of iterations required to converge or result in the "best" answer.
Hinted in my reply is that for PLA in particular, using any positive alpha gives you the same (equivalent) answer with exactly the same number of iterations. So convergence-wise, alpha doesn't affect PLA at all. Not necessarily true for other algorithms, of course.
__________________
When one teaches, two learn.
Reply With Quote
  #7  
Old 04-08-2012, 11:58 AM
tcristo tcristo is offline
Member
 
Join Date: Apr 2012
Posts: 23
Default Re: Impact of Alpha on PLA Converging

Quote:
Originally Posted by htlin View Post
Hinted in my reply is that for PLA in particular, using any positive alpha gives you the same (equivalent) answer with exactly the same number of iterations. So convergence-wise, alpha doesn't affect PLA at all. Not necessarily true for other algorithms, of course.
Intuitively this didn't make any sense to me. However, when running the PLA at different alphas using the same training set I can clearly see what you are saying is correct. Interesting that the weight ratio of x to y is exactly the same and so is the slope regardless of learning alpha.

After thinking about why this is the case I can almost understand it

Thanks for following up on my original question!

Last edited by tcristo; 04-08-2012 at 12:07 PM. Reason: spelling correction
Reply With Quote
  #8  
Old 04-08-2012, 12:52 PM
lacamotif lacamotif is offline
Junior Member
 
Join Date: Apr 2012
Posts: 9
Default Re: Impact of Alpha on PLA Converging

What is the range that we should expect the weighting factors to be around? Should it be less than 1, less than 10, or greater?

Any help appreciated - thanks.
Reply With Quote
  #9  
Old 04-08-2012, 01:07 PM
yaser's Avatar
yaser yaser is offline
Caltech
 
Join Date: Aug 2009
Location: Pasadena, California, USA
Posts: 1,477
Default Re: Impact of Alpha on PLA Converging

Quote:
Originally Posted by lacamotif View Post
What is the range that we should expect the weighting factors to be around? Should it be less than 1, less than 10, or greater?

Any help appreciated - thanks.
The size of the different components in {\bf w} can vary significantly based on the data set and the number of iterations.
__________________
Where everyone thinks alike, no one thinks very much
Reply With Quote
  #10  
Old 04-09-2012, 12:30 AM
kurts kurts is offline
Invited Guest
 
Join Date: Apr 2012
Location: Portland, OR
Posts: 70
Default Re: Impact of Alpha on PLA Converging

In my simulation, I plotted the random data points and the "true" f(x) line, and it helped me intuitively see that with many points (e.g. N=100), there is much less "wiggle room" for two lines to fit between the same set of "boundary" points (i.e. the set of points that are "closest" to the f(x) line.) With less points (say, N=10), there could be a huge variation in the slope and intercept of two lines that both "fit" the data.

I would think that you could get a better starting point than w = 0 by examining the data at the "boundary" points, where the result y changes from -1 to +1 and somehow use that information?
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 07:35 PM.


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.