View Single Post
  #40  
Old 04-17-2012, 01:35 PM
zsero zsero is offline
Junior Member
 
Join Date: Apr 2012
Posts: 6
Default Re: Perceptron Learning Algorithm

Quote:
Originally Posted by rukacity View Post
Argh! I am new to Python and did not know about numpy. It looks so much more concise than my code that has all the vector multiplication and what not. One thing I noticed is that you keep adding to weights for each wrongpoint whereas Yaser had mentioned to adjust it only once per iteration.
No, that's what the break statement does. Once it found a wrong point, it corrects and then brakes the cycle and then the whole loop starts again.

Yes, numpy is the best thing ever made for Python! Pseudoinverse of a matrix? np.pniv :-)
Reply With Quote