LFD Book Forum

LFD Book Forum (http://book.caltech.edu/bookforum/index.php)
-   Homework 1 (http://book.caltech.edu/bookforum/forumdisplay.php?f=130)
-   -   Doubt on weights and pla (http://book.caltech.edu/bookforum/showthread.php?t=3861)

Barath 01-16-2013 07:17 AM

Doubt on weights and pla
suppose i have a line f(x) = x , (for 2 dim) one side of which is +ve 1 and other side -ve 1..
Does this mean that target function is : [ -1 , 1] ? (since: -x + f(x) > 0 implies +ve 1 and -x + f(x) < 0 implies -ve 1)

and on running the PLA is the set of weights [-2 , 2] or any [-n, n] a valid solution for f(x) = x ? (since its just a constant to divide throughout?)

and when selecting random points, the PLA seems to run till infinity at times with
the same value of w repeating at regular intervals

am i getting the idea right here btw?

butterscotch 01-16-2013 07:42 PM

Re: Doubt on weights and pla
If it is already known that the target function is linear and passes through (0,0) (such as f(x) = x), then it is known that bias term will be zero. [ -1 , 1] makes sense, which is indeed equivalnet to [-n,n]. However, if it's not the case, you do need the bias term (weight vector will have length of 3), otherwise the algorithm may not converge.

Barath 01-17-2013 08:31 AM

Re: Doubt on weights and pla
Thanks for the idea about the bias it was really helpful! ... i tried a simple case for understanding better...

The PLA ran indefinitely because of the absence of bias (bias = 0 because of the target function i was having in my mind)
The problem was the random training points i generated based on the expected target function had a bit of a flaw that some points were present on the target function and not on either of its sides...further bias of 0 caused the PLA to generate lines that rotated about the origin alone..this at times prevented the algorithm to get to a solution and ran indefinitely!

Barath 01-17-2013 09:22 AM

Re: Doubt on weights and pla
This is what happened without bias ..this time it terminated...
(many at times it did not as data points increased)
(Green = expected , yellow = final result , red = trials)


All times are GMT -7. The time now is 02:36 PM.

Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2022, 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.