Upload cronyism.159.ino
Browse filesNeeded libraries to run program
- cronyism.159.ino +21 -0
cronyism.159.ino
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#include "MLPLibrary.h"
|
| 2 |
+
|
| 3 |
+
MLPLibrary mlp(2, 4, 1, 0.1);
|
| 4 |
+
|
| 5 |
+
void setup() {
|
| 6 |
+
// put your setup code here, to run once:
|
| 7 |
+
mlp.initialilze();
|
| 8 |
+
Serial.begin(9600);
|
| 9 |
+
}
|
| 10 |
+
|
| 11 |
+
void loop() {
|
| 12 |
+
// put your main code here, to run repeatedly:
|
| 13 |
+
float input[2] = {0.5, 0.3};
|
| 14 |
+
float target[1] = {0.7};
|
| 15 |
+
|
| 16 |
+
mlp.train(input, target);
|
| 17 |
+
|
| 18 |
+
float output[1];
|
| 19 |
+
mlp.predict(input, output);
|
| 20 |
+
Serial.println(output[1]);
|
| 21 |
+
}
|