4b9d615d302d51a836ec0e5db0d31666c9b546e8,examples/iyyer_dan.py,,main,#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#,139

Before Change


            prev_best = n_correct

    print("Evaluating")
    eval_data = list(read_data(data_dir / "test"))
    n_correct = sum(y[model.predict(x).guess] == 0 for x, y in eval_data)
    print(n_correct / len(eval_data))
 

if __name__ == "__main__":

After Change


        avg_grad = 0.0
        for X_y in minibatch(train_data, bs=batch_size):
            batch = model.train(X_y)
            if str(batch.loss) == "nan":
                raise Exception(batch.gradient)
            train_loss += batch.loss
            avg_grad += batch.l1_gradient
            //avg_grad += sum(abs(g) for g in batch.gradient) / model.model.nr_weight
        n_correct = sum(y[model.predict(x).guess] == 0 for x, y in dev_data)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 5

Instances


Project Name: explosion/thinc
Commit Name: 4b9d615d302d51a836ec0e5db0d31666c9b546e8
Time: 2016-01-04
Author: honnibal@gmail.com
File Name: examples/iyyer_dan.py
Class Name:
Method Name: main


Project Name: pantsbuild/pants
Commit Name: 3647ade36a5b7700fab508487665eb136da86931
Time: 2013-01-17
Author: ryan.blake.williams@gmail.com
File Name: src/python/twitter/pants/tasks/cache_manager.py
Class Name: VersionedTargetSet
Method Name: from_versioned_targets


Project Name: EpistasisLab/tpot
Commit Name: 050cb192f15e2d990df867360061081164e57868
Time: 2015-12-02
Author: bartleyn@uchicago.edu
File Name: tpot/tpot.py
Class Name: TPOT
Method Name: _evaluate_individual


Project Name: yahoo/TensorFlowOnSpark
Commit Name: e3caa24a93210c2fd6bf68ae8a9d510e3c58a59d
Time: 2019-08-16
Author: leewyang@verizonmedia.com
File Name: tensorflowonspark/pipeline.py
Class Name: TFEstimator
Method Name: _fit