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

  • Context: C/C++ 
  • Thread starter Thread starter Math Is Hard
  • Start date Start date
  • Tags Tags
    Algorithm
Click For Summary

Discussion Overview

The discussion centers around the challenges and experiences of writing a perceptron learning algorithm, particularly in C++. Participants compare this with implementations in other programming languages, such as MATLAB and Java. The conversation includes personal experiences, coding difficulties, and insights into artificial intelligence projects.

Discussion Character

  • Exploratory, Technical explanation, Debate/contested, Homework-related

Main Points Raised

  • Some participants have successfully written perceptron algorithms in C++, finding it manageable.
  • Others suggest that using a language specialized for matrix operations, like MATLAB, may offer advantages over C++.
  • One participant is attempting to diagram a simple two-input perceptron for learning the OR logic and expresses difficulty in the process.
  • Another participant shares a link to a perceptron implementation in Java, describing it as a simple proof of concept.
  • Participants express enthusiasm for coding artificial intelligence and share interest in various AI projects.

Areas of Agreement / Disagreement

There is no clear consensus on the difficulty of writing a perceptron algorithm in C++, as experiences vary among participants. Some find it straightforward, while others highlight potential challenges.

Contextual Notes

Participants mention specific programming languages and their respective advantages or challenges, but do not resolve the implications of these choices. The discussion includes references to personal projects and external resources without establishing their effectiveness or correctness.

Who May Find This Useful

Individuals interested in programming neural networks, particularly in C++ or other languages, as well as those exploring artificial intelligence projects.

Math Is Hard
Staff Emeritus
Science Advisor
Gold Member
Messages
4,663
Reaction score
36
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.
 

Similar threads

Replies
86
Views
3K
Replies
31
Views
4K
Replies
22
Views
3K
  • · Replies 133 ·
5
Replies
133
Views
13K
  • · Replies 8 ·
Replies
8
Views
4K
  • · Replies 25 ·
Replies
25
Views
1K
  • · Replies 6 ·
Replies
6
Views
2K
Replies
9
Views
3K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 43 ·
2
Replies
43
Views
8K