Exemplo n.º 1
0
def test_dataset_shuffle_setter():
    try:
        new_dataset = dataset.Dataset(shuffle=1.5)
    except:
        new_dataset = dataset.Dataset()

    assert new_dataset.shuffle is True
Exemplo n.º 2
0
def test_dataset_normalize_setter():
    try:
        new_dataset = dataset.Dataset(normalize=1.5)
    except:
        new_dataset = dataset.Dataset()

    assert new_dataset.normalize == (0, 1)
Exemplo n.º 3
0
def test_dataset_input_shape_setter():
    try:
        new_dataset = dataset.Dataset(input_shape=1.5)
    except:
        new_dataset = dataset.Dataset()

    assert new_dataset.input_shape is None
Exemplo n.º 4
0
def test_dataset_batch_size_setter():
    try:
        new_dataset = dataset.Dataset(batch_size=1.5)
    except:
        new_dataset = dataset.Dataset()

    try:
        new_dataset = dataset.Dataset(batch_size=-1)
    except:
        new_dataset = dataset.Dataset()

    assert new_dataset.batch_size == 1
Exemplo n.º 5
0
def test_dataset_preprocess():
    new_dataset = dataset.Dataset(input_shape=(2, 3))

    data = np.asarray([[1, 1, 1], [2, 2, 2]])

    proc_data = new_dataset.preprocess(data)

    assert proc_data.numpy()[0][0] == 0

    new_dataset = dataset.Dataset()

    proc_data = new_dataset.preprocess(data)

    assert proc_data.numpy()[0][0] == 0
Exemplo n.º 6
0
def test_dataset_build():
    new_dataset = dataset.Dataset()

    with pytest.raises(NotImplementedError):
        new_dataset._build()
Exemplo n.º 7
0
def test_dataset_batch_size():
    new_dataset = dataset.Dataset()

    assert new_dataset.batch_size == 1
Exemplo n.º 8
0
def test_dataset_shuffle():
    new_dataset = dataset.Dataset()

    assert new_dataset.shuffle is True
Exemplo n.º 9
0
def test_dataset_normalize():
    new_dataset = dataset.Dataset()

    assert new_dataset.normalize == (0, 1)
Exemplo n.º 10
0
def test_dataset_input_shape():
    new_dataset = dataset.Dataset()

    assert new_dataset.input_shape is None