Пример #1
0
def test_RecurrentConnection_forward_pass_single_samples():
    rc = RecurrentConnection(4)
    theta = 2 * np.eye(4).flatten()
    for x in X:
        x = np.atleast_2d(x)
        # for single samples recurrence should not do anything
        assert_equal(rc.forward_pass(theta, x), x)
Пример #2
0
def test_RecurrentConnection_forward_pass_single_samples():
    rc = RecurrentConnection(4)
    theta = 2 * np.eye(4).flatten()
    for x in X:
        x = np.atleast_2d(x)
        # for single samples recurrence should not do anything
        assert_equal(rc.forward_pass(theta, x), x)
Пример #3
0
def test_RecurrentConnection_forward_pass_multi_sample():
    fc = RecurrentConnection(4)
    theta = np.eye(4).flatten()
    X_summed = np.array([[0, 0, 0, 1], [1, 0, 0, 2],[1, 1, 0, 3],[1, 1, 1, 4],[2, 2, 1, 5]])
    assert_equal(fc.forward_pass(theta, X), X_summed)
Пример #4
0
def test_RecurrentConnection_forward_pass_multi_sample():
    fc = RecurrentConnection(4)
    theta = np.eye(4).flatten()
    X_summed = np.array([[0, 0, 0, 1], [1, 0, 0, 2], [1, 1, 0, 3],
                         [1, 1, 1, 4], [2, 2, 1, 5]])
    assert_equal(fc.forward_pass(theta, X), X_summed)