aboutsummaryrefslogtreecommitdiff
path: root/neural_network.py
diff options
context:
space:
mode:
Diffstat (limited to 'neural_network.py')
-rwxr-xr-xneural_network.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/neural_network.py b/neural_network.py
new file mode 100755
index 0000000..62f3f9c
--- /dev/null
+++ b/neural_network.py
@@ -0,0 +1,17 @@
+#!/usr/bin/env python
+
+from src.nn import MLP
+
+X = [
+ [ 0.0, 0.0, 0.0 ],
+ [ 1.0, 1.0, 1.0 ],
+ [ 2.0, 2.0, 2.0 ],
+ [ 3.0, 3.0, 3.0 ]
+]
+
+y = [ 1.0, 2.0, 3.0, 4.0 ] # X + 1
+
+n = MLP(3, [ 4, 4, 1 ])
+
+pred = [ n(x) for x in X ]
+print(pred)