Re: Perceptron Learning Algorithm
Quote:
I believe you will need to generate a separate set of test data to process and determine the error rate. Don't update the weights when processing the test data, just process each data point and determine whether it was correct or not. Aggregate those results and you should have your classifier error rate. BTW: This is how I did it which I guess shouldn't necessarily be confused with the correct way of doing it :D 
Re: Perceptron Learning Algorithm
Quote:
For example: if the target function was a 45degree st. line (x2=x1), and there was only one training data say ((x1(1),x2(1)),y(1))=((1,2),+1), and if our first hypothesis function was the horizontal axis itself, the Perceptron Algorithm would stop in its first iteration, and conclude the the horizontalaxis to be close to the Target function (which was actually 45degree line through origin). But if we increase the number of data, the hypothesis function is forced to converge towards the target function, with more iterations. But there will always be some discrepancy i guess, unless you are very lucky. 
Re: Perceptron Learning Algorithm
Quote:

Re: Perceptron Learning Algorithm
Quote:
http://book.caltech.edu/bookforum/sh...31&postcount=4 
Re: Perceptron Learning Algorithm
Quote:
Quote:
Quote:
http://book.caltech.edu/bookforum/sh...31&postcount=4 Hope this helps. 
Re: Perceptron Learning Algorithm
For answering Q7 and Q9: (just as an example) is 25 closer to 5 or closer to 50?
In other words is "closest" in q7/q9 defined using the absolute or relative difference. 25/5 = 5 and 50/25=2 so 25 is closer to 50 than to 5 using relative difference, while using absolute distance, 25 is closer to 5 than to 50. Hope the course staff can confirm which definition to use in answering the question. Many thanks!:bow: 
Re: Perceptron Learning Algorithm
Quote:

Re: Perceptron Learning Algorithm
I understand how to write the code to generate a random line and random points, which are assigned +/ based on their location relative to the line. (I'm assuming that [1,1]x[1,1] means the xy plane (the typical axis that I've been seeing since middle school... correct me if I'm wrong and that notation means something like binary space...)
I understand setting the initial weights to 0. Here is where I'm getting confused: When you say "sign(w0+w1x1+w2x2)", where if the function is positive, the outcome is +1 and visa versa, does the function itself actually generate a negative number? If so, how do you get it to generate a negative number when your learning algorithm takes steps of positive 1? Let's say that my f function is something simple like y=2x. Let's say that my random points lie on each side of the line such that I end up with the following points: (1,1,3), (1,3,7), (1,2,3), and (1,4,7). These map ++ and  , since they are on opposite sides of the line. During the initial step, setting the weights equal to zero yields zero on each of these functions. So, we iterate once by setting the weights equal to 1. Plugging the weights into the first two points yields a positive value. (1+1+3) and (1+3+7) Yet, the bottom two points are still positive. As long as my iterative step is a positive 1, I can't get a negative number in the bottom rows. How does that work? Is that even how the learning is supposed to function? 
Re: Perceptron Learning Algorithm
Quote:
Quote:
Quote:
let k =<w[1], w[2]>. k is like a direction of a gradient, where it goes linearly from 0 to 1 in the length of k. w[0] is a distance along k we draw our line at. This means that the dot product of x[n] and w can be thought of as a measure of "agreement". By the 2d vector analogy from class(which holds in 3d), you can see that in one simple step we can improve this "agreement" from bad to good because we know which way in the 3space must be better (y[n]*x[n]). The miracle of the Perceptron is that just by doing this several times, we *will always* arrive at an acceptable answer. 
Re: Perceptron Learning Algorithm
Another question: My PLA converges, there's no problem with that. But given sample sizes (N = 10 and N = 100), I have to choose the same answer for both iterations questions. Is that OK?

All times are GMT 7. The time now is 09:13 AM. 
Powered by vBulletin® Version 3.8.3
Copyright ©2000  2021, Jelsoft Enterprises Ltd.
The contents of this forum are to be used ONLY by readers of the Learning From Data book by Yaser S. AbuMostafa, Malik MagdonIsmail, and HsuanTien Lin, and participants in the Learning From Data MOOC by Yaser S. AbuMostafa. No part of these contents is to be communicated or made accessible to ANY other person or entity.