Exemple #1
0
    def test_are_equal(self):
        a = [np.array([[1, 2, 3], [4, 5, 6]]),
             np.array([[1, 2, 3], [4, 5, 6]])]
        b = [np.array([[1, 2, 3], [4, 5, 6]]),
             np.array([[1, 2, 3], [4, 5, 6]])]

        self.assertTrue(util.list_of_arrays_is_equal(a, b))
Exemple #2
0
    def test_get_set_wages_give_same_result(self):
        nn = layer.NN(5, [3,2,1], 4)
        nn.random_init()
        w = nn.get_wages()
        for l in nn.layers[1:]:
            l.W[0,0] = -17
        nn.set_wages(w)
        w2 = nn.get_wages()

        self.assertTrue(util.list_of_arrays_is_equal(w, w2))