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...
What percentage of programmers have learned to touch type? Have you? Do you think it's important, not just for programming, but for more-than-casual computer users generally? ChatGPT didn't have much on it ("Research indicates that less than 20% of people can touch type fluently, with many relying on the hunt-and-peck method for typing ."). 'Hunt-and-peck method' made me smile. It added, "For programmers, touch typing is a valuable skill that can enhance speed, accuracy, and focus. While...
I had a Microsoft Technical interview this past Friday, the question I was asked was this : How do you find the middle value for a dataset that is too big to fit in RAM? I was not able to figure this out during the interview, but I have been look in this all weekend and I read something online that said it can be done at O(N) using something called the counting sort histogram algorithm ( I did not learn that in my advanced data structures and algorithms class). I have watched some youtube...
Back
Top