C/C++ Is It Challenging to Write a Perceptron Learning Algorithm in C++?

  • Thread starter Thread starter Math Is Hard
  • Start date Start date
  • Tags Tags
    Algorithm
AI Thread Summary
The discussion centers around the implementation of a perceptron learning algorithm, with participants sharing their experiences in different programming languages. One user successfully wrote a simple perceptron in C++, noting that it was not overly complicated, while acknowledging that more complex algorithms like backpropagation for neural networks present greater challenges. Another participant is attempting to diagram a two-input perceptron to learn the OR logic function but is facing difficulties and plans to seek help if they cannot resolve the issues soon. The conversation highlights the advantages of using specialized matrix programming environments, like MATLAB, over C++ for certain tasks. Additionally, there is enthusiasm for artificial intelligence projects, with mentions of interesting AI applications, such as a program that assembles jigsaw puzzles. A user also shares a link to their Java implementation of a perceptron as a simple proof of concept, providing resources for others interested in the topic.
Math Is Hard
Staff Emeritus
Science Advisor
Gold Member
Messages
4,650
Reaction score
39
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)?
 
Technology news on Phys.org
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.
 
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:
 
Coding up artificial intelligence is really neat when it works. :smile:
 
Hurkyl said:
Coding up artificial intelligence is really neat when it works. :smile:

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!
 
Hi:

I have the perceptron code in JAVA. Is a very simple proof of concepto. I give you a link to my site. The page is in spanish but you can download it from the very bottom of the page.

http://www.tecnohobby.net/ppal/index.php?option=com_content&view=article&id=22:perceptron&catid=42:rna&Itemid=19

Hope it is helpfull.
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I have a quick questions. I am going through a book on C programming on my own. Afterwards, I plan to go through something call data structures and algorithms on my own also in C. I also need to learn C++, Matlab and for personal interest Haskell. For the two topic of data structures and algorithms, I understand there are standard ones across all programming languages. After learning it through C, what would be the biggest issue when trying to implement the same data...
Back
Top