6ac9487579408b1ee452fbb27ef4c781882d085c,examples/mnist_mlp.py,,main,#Any#Any#Any#,14

Before Change


                yh, backprop = model.begin_update(X)
                loss, d_loss = categorical_crossentropy(y, yh)
                backprop(d_loss)
                for name, param, d_param in model.weights:
                    if d_param is not None:
                        optimizer(param, d_param, key=name)
                
            with model.use_params(optimizer.averages):
                dev_acc_avg = model.evaluate(dev_X, dev_Y)
                print("Avg dev.: %.3f" % dev_acc_avg)

After Change



    with model.begin_training(train_X, train_Y) as trainer, optimizer:
        trainer.each_epoch(print_accuracy(dev_X, dev_y))
        for X, y in trainer.iterate(train_X, train_y):
            yh, backprop = model.begin_update(X, drop=trainer.dropout)
            loss, d_loss = categorical_crossentropy(guess, yh)
            backprop(d_loss, optimizer(loss))
    with model.use_params(optimizer.averages):
        print("Avg dev.: %.3f" % model.evaluate(dev_X, dev_Y))
        print("Avg test.: %.3f" % model.evaluate(test_X, test_Y))
        with open("out.pickle", "wb") as file_:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 4

Instances


Project Name: explosion/thinc
Commit Name: 6ac9487579408b1ee452fbb27ef4c781882d085c
Time: 2017-01-13
Author: honnibal+gh@gmail.com
File Name: examples/mnist_mlp.py
Class Name:
Method Name: main


Project Name: pantsbuild/pants
Commit Name: 80b3d3c1b2ce855fad39a2c88976f587241fd228
Time: 2015-12-16
Author: benjyw@gmail.com
File Name: src/python/pants/help/help_printer.py
Class Name: HelpPrinter
Method Name: _print_options_help


Project Name: google/deepvariant
Commit Name: af5e6d9aa0e76219e8a83867d9be9b97fc53eb51
Time: 2019-03-12
Author: no-reply@google.com
File Name: third_party/nucleus/io/tfrecord.py
Class Name:
Method Name: read_shard_sorted_tfrecords


Project Name: google/nucleus
Commit Name: 80428c10b08d80dfea7e55c06bbc17169e402374
Time: 2019-03-12
Author: no-reply@google.com
File Name: nucleus/io/tfrecord.py
Class Name:
Method Name: read_shard_sorted_tfrecords