Go Down

Topic: Neural Network Arduino (Read 10394 times) previous topic - next topic

PhDMedina

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(8);

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

ishakin


PaulS

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?



cr0sh

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...

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

Go Up