From 3ed1c5d0e4018fc70012a6209a859a059f7127b5 Mon Sep 17 00:00:00 2001 From: zhang Date: Fri, 25 Mar 2022 00:11:34 +0800 Subject: =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- network/logic_gates.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 network/logic_gates.py (limited to 'network/logic_gates.py') 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 -- cgit v1.2.3