647e3d6fafe38887e9db55d6f489b64ea07e3af1,examples/vision/mnist/classification_bnn.py,,train,#,222

Before Change


        monitor_loss.add(i, loss.d.copy())
        monitor_err.add(i, e)
        monitor_time.add(i)
    nn.save_parameters(os.path.join(args.model_save_path,
                                    "params_%06d.h5" % args.max_iter))


if __name__ == "__main__":
    train()

After Change


        monitor_err.add(i, e)
        monitor_time.add(i)

    parameter_file = os.path.join(
        args.model_save_path, "params_%06d.h5" % args.max_iter)
    structure_file = os.path.join(
        args.model_save_path, "params_%06d.nntxt" % args.max_iter)
    nnp_file = os.path.join(
        args.model_save_path, "{}_{:06}.nnp".format(args.net, args.max_iter))
    runtime_contents = {
        "networks": [
            {"name": "Validation",
             "batch_size": args.batch_size,
             "variable": vpred}],
        "executors": [
            {"name": "Runtime",
             "network": "Validation",
             "variables": ["x", "y"]}]}

    nn.save_parameters(parameter_file)
    save.save(structure_file, runtime_contents)
    save.save(nnp_file, runtime_contents)

Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 3

Instances


Project Name: sony/nnabla
Commit Name: 647e3d6fafe38887e9db55d6f489b64ea07e3af1
Time: 2017-08-18
Author: Naoki.Ide@sony.com
File Name: examples/vision/mnist/classification_bnn.py
Class Name:
Method Name: train


Project Name: sony/nnabla
Commit Name: 5aa0e65747cd13c072749cbc7364f61bd149cadf
Time: 2020-03-24
Author: Yuchi.Wen@sony.com
File Name: python/src/nnabla/utils/save.py
Class Name:
Method Name: save


Project Name: dmlc/gluon-nlp
Commit Name: 6bd7b2ef55aaabc65c5910c026760c7be8a50a48
Time: 2018-09-02
Author: leonard@lausen.nl
File Name: scripts/word_embeddings/train_fasttext.py
Class Name:
Method Name: train


Project Name: sony/nnabla
Commit Name: 647e3d6fafe38887e9db55d6f489b64ea07e3af1
Time: 2017-08-18
Author: Naoki.Ide@sony.com
File Name: examples/vision/mnist/siamese.py
Class Name:
Method Name: train