Ejemplo n.º 1
0
def test_node_consistency():
    graph = CnnGenerator(10, (32, 32, 3)).generate()
    assert graph.layer_list[6].output.shape == (16, 16, 64)

    for layer in graph.layer_list:
        assert layer.output.shape == layer.output_shape

    graph.to_wider_model(5, 64)
    assert graph.layer_list[5].output.shape == (16, 16, 128)

    for layer in graph.layer_list:
        assert layer.output.shape == layer.output_shape

    graph.to_conv_deeper_model(5, 3)
    assert graph.layer_list[19].output.shape == (16, 16, 128)

    for layer in graph.layer_list:
        assert layer.output.shape == layer.output_shape

    graph.to_add_skip_model(5, 18)
    assert graph.layer_list[23].output.shape == (16, 16, 128)

    for layer in graph.layer_list:
        assert layer.output.shape == layer.output_shape

    graph.to_concat_skip_model(5, 18)
    assert graph.layer_list[25].output.shape == (16, 16, 256)

    for layer in graph.layer_list:
        assert layer.output.shape == layer.output_shape
Ejemplo n.º 2
0
def test_node_consistency():
    graph = CnnGenerator(10, (32, 32, 3)).generate()
    assert graph.layer_list[6].output.shape == (16, 16, 64)

    for layer in graph.layer_list:
        assert layer.output.shape == layer.output_shape

    graph.to_wider_model(6, 64)
    assert graph.layer_list[6].output.shape == (16, 16, 128)

    for layer in graph.layer_list:
        assert layer.output.shape == layer.output_shape
Ejemplo n.º 3
0
def test_node_consistency():
    graph = CnnGenerator(10, (32, 32, 3)).generate()
    assert graph.layer_list[6].output.shape == (16, 16, 64)

    for layer in graph.layer_list:
        assert layer.output.shape == layer.output_shape

    graph.to_wider_model(6, 64)
    assert graph.layer_list[6].output.shape == (16, 16, 128)

    for layer in graph.layer_list:
        assert layer.output.shape == layer.output_shape