Pages: [1]   Go Down
Author Topic: Neural Network Arduino  (Read 7142 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 1
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hola!
developing a perceptron in Arduino, Arduino is:

#include <math.h>

int p1;
int p2;
int n;

void setup() {
pinMode(13, OUTPUT);
pinMode(7, INPUT);
pinMode(8, INPUT);
}

void loop(){
p1=digitalRead(7);
p2=digitalRead(smiley-cool;

n=((1*p1)+(2*p2))+(-3);

if (n>=0) {
digitalWrite(13, HIGH);
} else {
digitalWrite(13, LOW);
}
}

this is a simple two-input perceptron from here you develop RNA complete luck

Dr. Alejandro Medina Santiago
Instituto Tecnologico de Tuxtla Gutierrez
Posgrade Mechatronic
Chiapas, México
medinas23@yahoo.com.mx
Logged

Chiapas
Offline Offline
Newbie
*
Karma: 0
Posts: 1
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

copy-paste!
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 617
Posts: 49463
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I really have no clue what either of you are talking about.

What is supposed to be connected to pins 7 and 8? What does multiplying p1 by 1 accomplish? Why is it necessary to add -3. Why not just subtract 3?

Quote
this is a simple two-input perceptron from here you develop RNA complete luck
Say what?


Logged

Phoenix, Arizona USA
Offline Offline
Faraday Member
**
Karma: 40
Posts: 5581
Where's the beer?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Say what?

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

Basically what was coded was the simplest form of a perceptron artificial neuron (although in the example, the bias value is -3 - honestly, to be closer to the description on wikipedia, "n" should be "n=((-1*p1)+(-2*p2))+3" - or something like that; there's nothing technically wrong with the way its presented, though).

Still, this is the simplest version - a real perceptron capable of doing anything useful would need many more inputs, and the calculation would be done upon an array or similar method.

I'm not really sure what the point of this posting was for, though, as anyone with a passing familiarity with neural networks would be able to devise something like this; what would be more interesting would be a demonstration of a 3-layer ANN with back-propagation or some other self-learning mechanism.

Perhaps in the form of a line follower or similar small-scale robot...

 smiley
Logged

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

Pages: [1]   Go Up
Jump to: