534f6b7975dcd334f6d68eef14598d75c79e7921,tests/test_model_saving.py,,test_sequential_model_saving_2,#,51

Before Change


    fname = "tmp_" + str(np.random.randint(10000)) + ".h5"
    save_model(model, fname)

    new_model = load_model(fname)
    os.remove(fname)

    out2 = new_model.predict(x)
    assert_allclose(out, out2, atol=1e-05)

    // test that new updates are the same with both models
    x = np.random.random((1, 3))
    y = np.random.random((1, 3, 3))
    model.train_on_batch(x, y)
    new_model.train_on_batch(x, y)
    out = model.predict(x)
    out2 = new_model.predict(x)
    assert_allclose(out, out2, atol=1e-05)


@keras_test

After Change


    fname = "tmp_" + str(np.random.randint(10000)) + ".h5"
    save_model(model, fname)

    model = load_model(fname,
                       custom_objects={"custom_opt": custom_opt,
                                       "custom_loss": custom_loss})
    os.remove(fname)

    out2 = model.predict(x)
    assert_allclose(out, out2, atol=1e-05)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: keras-team/keras
Commit Name: 534f6b7975dcd334f6d68eef14598d75c79e7921
Time: 2016-08-28
Author: francois.chollet@gmail.com
File Name: tests/test_model_saving.py
Class Name:
Method Name: test_sequential_model_saving_2


Project Name: deepmipt/DeepPavlov
Commit Name: b1eaa3487165ebaedb489ced63a38eb45f650b5f
Time: 2018-10-17
Author: yoptar@gmail.com
File Name: deeppavlov/models/embedders/fasttext_embedder.py
Class Name: FasttextEmbedder
Method Name: load


Project Name: NervanaSystems/nlp-architect
Commit Name: 6c3f6bc6046f6c61b9b0baba1e8b5b9a7c437727
Time: 2018-10-11
Author: peteriz@users.noreply.github.com
File Name: nlp_architect/models/intent_extraction.py
Class Name: IntentExtractionModel
Method Name: load