Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Perceptron learning algorithm?

  1. Sep 14, 2007 #1

    Math Is Hard

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    Have you ever written a perceptron learning algorithm?

    http://en.wikipedia.org/wiki/Perceptron

    Which language did you use? Would it be overly complicated to try to write it in C++ (compared with, say, MATLAB)?
     
  2. jcsd
  3. Sep 17, 2007 #2
    Hello,

    yes, I have. I wrote it in C++ and it was not so hard. Simple perceptron is not very hard problem. Harder ist to write backprogation algorithm for a forward or recurent neural network.
     
  4. Sep 18, 2007 #3

    Math Is Hard

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    Thanks for your reply. I am still trying to work it out on paper, and now I can see how a program that is specialized for matrices could have an advantage over implementing it in C++.

    I have been trying to diagram out a simple two-input perceptron that will take a training set to learn the logic for OR, but I have been getting stuck. If I can't figure it out in a couple of days, I'll put up a diagram and some pseudocode and maybe you could help me figure out where I am going wrong. I agree - this should be simple!!! :redface:
     
  5. Sep 22, 2007 #4

    Math Is Hard

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    I think I have gotten the thing worked out and written up in C++. The part that was tripping me up was figuring out how to use my array of four delta values (desired output minus actual output), along with the training set inputs, to go back and update the two weights, but I think I have that sorted out now.

    Here is some output from a run that starts with weight values of 2 and -2 and a bias of -1.

    [​IMG]

    My training input set looks like this:
    0 0
    1 0
    0 1
    1 1

    I am surprised at how fast the weights "settle down" to values that work.
     
  6. Sep 22, 2007 #5

    Hurkyl

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    Coding up artificial intelligence is really neat when it works. :smile:
     
  7. Sep 22, 2007 #6

    Math Is Hard

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    I've looked at the course websites for various AI classes and some of the projects they do look really fun. One team had created a program that took scanned pieces of a jigsaw puzzle and put them together. I thought that was very cool!
     
  8. Apr 8, 2011 #7
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: Perceptron learning algorithm?
  1. VEGAS algorithm (Replies: 2)

  2. Ask an algorithm (Replies: 3)

  3. Knuth Algorithm (Replies: 3)

Loading...