a58bb4244b3b5ffbf7ffb1994926fcbe8cfa0c1d,src/evaluate.py,,evaluate,#Any#Any#Any#Any#Any#,10

Before Change



            // get predictions
            if isinstance(task, (RegressionTask, STSBTask, JOCITask)):
                preds, _ = out["logits"].max(dim=1)
            else:
                _, preds = out["logits"].max(dim=1)
            task_preds += preds.data.tolist()

After Change


            n_examples += out["n_exs"]

            // get predictions
            if "preds" in out:
                preds = out["preds"]
                if isinstance(preds, torch.Tensor):
                    preds = preds.data.tolist()
                assert isinstance(preds, list), "Convert predictions to list!"
                task_preds += preds

        // Update metrics
        task_metrics = task.get_metrics(reset=True)
        for name, value in task_metrics.items():
            all_metrics["%s_%s" % (task.name, name)] = value
        all_metrics["micro_avg"] += all_metrics[task.val_metric] * n_examples
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: jsalt18-sentence-repl/jiant
Commit Name: a58bb4244b3b5ffbf7ffb1994926fcbe8cfa0c1d
Time: 2018-07-05
Author: wang.alex.c@gmail.com
File Name: src/evaluate.py
Class Name:
Method Name: evaluate


Project Name: scikit-optimize/scikit-optimize
Commit Name: 9cdd21160f4b4352b05f7b7ce9f0f63506c585c9
Time: 2017-04-17
Author: iaroslav-ai@users.noreply.github.com
File Name: benchmarks/bench_ml.py
Class Name: MLBench
Method Name: evaluate


Project Name: snipsco/snips-nlu
Commit Name: 2316ac84ba197184254119c2a8c4aef2f1aac1c2
Time: 2017-11-29
Author: adrien.ball@snips.net
File Name: snips_nlu/tests/test_feature_functions.py
Class Name: TestFeatureFunctions
Method Name: test_crf_features