From dbd0506e4c9bee20a1858f122be8ae9b6cf33145 Mon Sep 17 00:00:00 2001 From: Trygve Date: Wed, 25 Oct 2023 14:12:34 +0200 Subject: [PATCH] uke5 --- uke5.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 uke5.py diff --git a/uke5.py b/uke5.py new file mode 100644 index 0000000..54749ca --- /dev/null +++ b/uke5.py @@ -0,0 +1,25 @@ +import numpy as np + +def relu(y): + return np.maximum(0, y) + +def layer(W, x, b): + return relu(W @ x + b) + +n = [64,128,128,128,10] + +print(f"Dimensions: {n}") + +# First layer +x = np.random.rand(n[0]) +b = np.random.rand(n[1]) +y = np.random.rand(128,64) + +y = layer(y, x, b) + +for i in range(2, len(n)): + W = np.random.rand(n[i], n[i - 1]) + b = np.random.rand(n[i]) + y = layer(W, y, b) + +print(y)