Beispiel #1
0
 def feed_backwards(self, x: np.ndarray) -> np.ndarray:
     v = np.zeros((1, 28 * 28))
     v[:, 0:10] = x
     x = homogenize_vector(v)
     for m in self.R:
         x[:, :-1] = self.ai(np.clip(x[:, :-1], 0.000000001, 0.999999999))
         x = np.matmul(x, m)
     return x[:, :-1]
Beispiel #2
0
 def feed_backwards(self, x: np.ndarray) -> np.ndarray:
     x = homogenize_vector(x)
     for m in self.R:
         x[:, :-1] = self.ai(np.clip(x[:, :-1], 0.000000001, 0.999999999))
         x = np.matmul(x, m)
     return x[:, :-1]
Beispiel #3
0
 def feed_forward(self, x: np.ndarray) -> np.ndarray:
     x = homogenize_vector(x)
     for m in self.M:
         x = np.matmul(x, m)
         x[:, :-1] = self.a(np.clip(x[:, :-1], -500, 500))
     return x[:, :-1]
 def feed_backwards(self, x: np.ndarray) -> np.ndarray:
     x = homogenize_vector(self.ai(np.clip(x, 0.000000001, 0.999999999)))
     x = np.matmul(x, self.R)
     return x[:, :-1]
Beispiel #5
0
 def feed_backwards(self, x: np.ndarray) -> np.ndarray:
     x = homogenize_vector(x)
     x = np.matmul(x, self.R)
     return x[:, :-1]
Beispiel #6
0
 def feed_forward(self, x: np.ndarray) -> np.ndarray:
     x = homogenize_vector(x)
     x = np.matmul(x, self.M)
     return x[:, :-1]