Example #1
0
def test_one_hot():
    skip_if_no_data()
    data = icml07.MNIST_rotated_background(which_set='train', one_hot=True,
                                           split=(100, 100, 100))
    assert data.y.shape[1] == 10   # MNITS hast 10 classes

    data = icml07.Rectangles(which_set='train', one_hot=True,
                             split=(100, 100, 100))
    assert data.y.shape[1] == 2   # Two classes
Example #2
0
def test_split():
    skip_if_no_data()
    n_train = 100
    n_valid = 200
    n_test = 300

    data = icml07.MNIST_rotated_background(which_set='train',
                                           split=(n_train, n_valid, n_test))
    assert data.X.shape[0] == n_train, "Unexpected size of train set"
    assert data.y.shape[0] == n_train, "Unexpected size of train set"

    data = icml07.MNIST_rotated_background(which_set='valid',
                                           split=(n_train, n_valid, n_test))
    assert data.X.shape[0] == n_valid, "Unexpected size of validation set"
    assert data.y.shape[0] == n_valid, "Unexpected size of validation set"

    data = icml07.MNIST_rotated_background(which_set='test',
                                           split=(n_train, n_valid, n_test))
    assert data.X.shape[0] == n_test, "Unexpected size of test set"
    assert data.y.shape[0] == n_test, "Unexpected size of test set"
Example #3
0
def test_MNIST_rot_back():
    skip_if_no_data()
    data = icml07.MNIST_rotated_background(which_set='train')
    data = icml07.MNIST_rotated_background(which_set='valid')
    data = icml07.MNIST_rotated_background(which_set='test')