aboutsummaryrefslogtreecommitdiff
path: root/neural_network.py
diff options
context:
space:
mode:
authorRaghuram Subramani <raghus2247@gmail.com>2024-06-09 08:50:49 +0530
committerRaghuram Subramani <raghus2247@gmail.com>2024-06-09 08:50:49 +0530
commit194f7d40561485f5ac3a3556721cfbc542be3b07 (patch)
tree49edbcc9f1daf378396a8dd6a31c0078df3976f6 /neural_network.py
parent40240b0b383abc2d3e81e2bcfe5e4b6d6fdfec2a (diff)
Update
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)