d6c1b86594ef9a97e9f503547ab6567f89508486,tests/integration_tests/test_experiment.py,,test_visual_question_answering,#Any#,377

Before Change



def test_visual_question_answering(csv_filename):
    image_dest_folder = os.path.join(os.getcwd(), "generated_images")
    input_features = Template(
        "[{name: image_path, type: image, encoder: stacked_cnn, preprocessing:"
        "{width: 10, height: 10, num_channels: 3}, resnet_size: 8, fc_size: 32,"
        "destination_folder: ${folder}}, {name: question, type: text, "
        "vocab_size: 20, max_len: 10,encoder: parallel_cnn, "
        "level: word}]").substitute(
        folder=image_dest_folder)

    output_features = "[ {name: answer, type: sequence, max_len: 5, " \
                      "vocab_size: 10, decoder: generator, cell_type: lstm}]"

    rel_path = generate_data(input_features, output_features, csv_filename)
    run_experiment(input_features, output_features, rel_path)

    // Delete the temporary data created
    all_images = glob.glob(os.path.join(image_dest_folder, "*.jpg"))
    for im in all_images:
        os.remove(im)

    os.rmdir(image_dest_folder)


def test_image_resizing_num_channel_handling(csv_filename):

After Change



def test_visual_question_answering(csv_filename):
    image_dest_folder = os.path.join(os.getcwd(), "generated_images")
    input_features = [
        image_feature(
            folder=image_dest_folder,
            encoder="resnet",
            preprocessing={
                "in_memory": True,
                "height": 8,
                "width": 8,
                "num_channels": 3
            },
            fc_size=8,
            num_filters=8
        ),
        text_feature(encoder="embed", min_len=1, level="word"),
    ]
    output_features = [sequence_feature(decoder="generator", cell_type="lstm")]
    rel_path = generate_data(input_features, output_features, csv_filename)
    run_experiment(input_features, output_features, data_csv=rel_path)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 15

Instances


Project Name: uber/ludwig
Commit Name: d6c1b86594ef9a97e9f503547ab6567f89508486
Time: 2019-05-01
Author: smiryala@uber.com
File Name: tests/integration_tests/test_experiment.py
Class Name:
Method Name: test_visual_question_answering


Project Name: uber/ludwig
Commit Name: d6c1b86594ef9a97e9f503547ab6567f89508486
Time: 2019-05-01
Author: smiryala@uber.com
File Name: tests/integration_tests/test_experiment.py
Class Name:
Method Name: test_visual_question_answering


Project Name: uber/ludwig
Commit Name: d6c1b86594ef9a97e9f503547ab6567f89508486
Time: 2019-05-01
Author: smiryala@uber.com
File Name: tests/integration_tests/test_experiment.py
Class Name:
Method Name: test_experiment_image_inputs


Project Name: uber/ludwig
Commit Name: d6c1b86594ef9a97e9f503547ab6567f89508486
Time: 2019-05-01
Author: smiryala@uber.com
File Name: tests/integration_tests/test_experiment.py
Class Name:
Method Name: test_image_resizing_num_channel_handling