summaryrefslogtreecommitdiff
path: root/network/logic_gates.py
diff options
context:
space:
mode:
authorzhang <zch921005@126.com>2022-03-25 00:11:34 +0800
committerzhang <zch921005@126.com>2022-03-25 00:11:34 +0800
commit3ed1c5d0e4018fc70012a6209a859a059f7127b5 (patch)
tree2ca318fb2e23daf2964189a751fb61b20aa7515a /network/logic_gates.py
parent6f68e1818229e0d2dad760062e6b5bb137b88f5b (diff)
更新脚本
Diffstat (limited to 'network/logic_gates.py')
-rw-r--r--network/logic_gates.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/network/logic_gates.py b/network/logic_gates.py
new file mode 100644
index 0000000..2a33d16
--- /dev/null
+++ b/network/logic_gates.py
@@ -0,0 +1,13 @@
+import torch
+
+
+def and_gate():
+ and_weights = torch.tensor([1, 1, -2])
+
+
+if __name__ == '__main__':
+ # x1, x2, b
+ X = torch.tensor([(0, 0, 1), (0, 1, 1), (1, 0, 1), (1, 1, 1)], dtype=torch.double)
+
+ print(X)
+ pass