Ejemplo n.º 1
0
 def compute_gradients(self, X, y):
     a,b = self.alternative_cost_prime(X, y)
     return util.unwrap_matrix([a,b])
Ejemplo n.º 2
0
 def get_wages(self):
     return util.unwrap_matrix([self.W1, self.W2])
def compute_gradients(network, X, y):
    a, b = network.cost_prime(X, y)
    return util.unwrap_matrix([a,b])
Ejemplo n.º 4
0
 def test_unwrap(self):
     a = np.array([[1, 2], [3, 4]])
     b = np.array([[5, 6], [7, 8]])
     flat = util.unwrap_matrix([a, b])
     print(flat)
     assert np.array_equal(flat, np.array([1, 2, 3, 4, 5, 6, 7, 8]))
Ejemplo n.º 5
0
 def get_wages(self):
     all_wages = [layer.W for layer in self.layers]
     return util.unwrap_matrix(all_wages)