
#1




Perceptron Learning Algorithm
I'm trying to program the perceptron example but can't figure out how to assign the sign of the first step.
I drew a line between two points on the xy plane [1,1] in both directions. Then I randomly generated another 10 points, assigning them +1 if they fell above the line and 1 if they fell below the line. I stored those values in ideal function g. Then I gave each point a random first guess of +1/1 as my initial function h. If I start with all the weights as 0, then w*x = 0 for all points. At that rate, PLA will never converge. What is my conceptual error? 
#2




Re: Perceptron Learning Algorithm
Quote:
Quote:
Quote:
__________________
Where everyone thinks alike, no one thinks very much 
#3




Re: Perceptron Learning Algorithm
Hi
I have a question about how weighting is assigned and the meaning of the PLA . For point a1 which has assignment 1, does w(a1.y) + w(a1.x) = 1 ? ( '.' denotes subscript) And then, for point a2 which has assignment 1, would w(a1.y) + w(a1.x) + w(a1.x) + w(a2.x) = 1 , and so on? To adjust weighting of w for misclassified points, is w.x2 = w.x1 + x.2 * y.2 Thank you for the help! 
#4




Re: Perceptron Learning Algorithm
Quote:
Either point, call it just for simplicity, is a vector that has components . Notice that bold denotes a full data point, while italic denotes a component in that data point. We add a constant 1 component to each data point and call the component to simplify the expression for the perceptron. If the weight vector of the perceptron is (where takes care of the threshold value of that perceptron), then the perceptron implements where returns if its argument is positive and returns if its argument is negative. Example: Say the first data point (two dimensional, so ). Add the constant component and you have . Therefore, the percepton's output on this point is . If this formula returns which is different from the target output , the PLA adjusts the values of the weights trying to make the perceptron output agree with the target output for this point . It uses the specific PLA update rule to achieve that.
__________________
Where everyone thinks alike, no one thinks very much 
#5




Re: Perceptron Learning Algorithm
Thank you for your reply!
So, y.n for point 2 has nothing to do with point 1, correct? Also, since w.0, w.1 and w.2 are different numbers, do you need multiple points to assess the values of the three w's? Further, is updated w like an array, dependent on which n is being chosen, or is it one uniform number that is applied to all x's? 
#6




Re: Perceptron Learning Algorithm
Quote:
All three components of the weight vector are simultaneously updated by PLA at each iteration, and there is more than one data point to update depending on which points are misclassified at a given time as the algorithm runs.
__________________
Where everyone thinks alike, no one thinks very much 
#7




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? 
#8




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. 
#9




Re: Perceptron Learning Algorithm
Quote:

#10




Re: Perceptron Learning Algorithm
Quote:

Thread Tools  
Display Modes  

