Ejemplo n.º 1
0
def test_conv2D_block_vanilla():
    v = K.variable(np.ones([1, 16, 16, 1]), dtype=np.float32)
    out = conv2d_block(v, use_batch_norm=True)
    assert out.shape.as_list() == [1, 16, 16, 16]
Ejemplo n.º 2
0
def test_conv2d_block_unsupported_dropout():
    v = K.variable(np.ones([1, 16, 16, 1]), dtype=np.float32)
    with pytest.raises(ValueError):
        out = conv2d_block(v, use_batch_norm=True, dropout_type="foo")
Ejemplo n.º 3
0
def test_conv2D_block_elu():
    v = K.variable(np.ones([1, 32, 32, 1]), dtype=np.float32)
    out = conv2d_block(v, activation="elu")
    assert out.shape.as_list() == [1, 32, 32, 16]
Ejemplo n.º 4
0
def test_conv2D_block_standard_dropout():
    v = K.variable(np.ones([1, 16, 16, 1]), dtype=np.float32)
    out = conv2d_block(v, use_batch_norm=True, dropout_type="standard")
    assert out.shape.as_list() == [1, 16, 16, 16]
Ejemplo n.º 5
0
def test_conv2D_block_filters():
    v = K.variable(np.ones([1, 32, 32, 1]), dtype=np.float32)
    out = conv2d_block(v, use_batch_norm=False, filters=32)
    assert out.shape.as_list() == [1, 32, 32, 32]