b05b32dad4671f8e3575baf775f82be03617e1e7,elephas/spark_model.py,SparkModel,_evaluate,#SparkModel#Any#,209

Before Change


            return [model.evaluate(x_test, y_test)]
        if self.num_workers:
            rdd = rdd.repartition(self.num_workers)
        results = rdd.mapPartitions(partial(_evaluate, yaml_model, optimizer, loss, custom_objects)).mean()
        return results

After Change


            return results.mean()
        else:
            // if we do have metrics, we want to return a list of [loss value, metric value] - to match the keras API
            loss_value = results.map(lambda x: x[0]).mean()
            metric_value = results.map(lambda x: x[1]).mean()
            return [loss_value, metric_value]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: maxpumperla/elephas
Commit Name: b05b32dad4671f8e3575baf775f82be03617e1e7
Time: 2021-01-24
Author: danielenricocahall@gmail.com
File Name: elephas/spark_model.py
Class Name: SparkModel
Method Name: _evaluate


Project Name: snorkel-team/snorkel
Commit Name: b8e47c23af012e0396d8d55aaf9a74d5c2376bf7
Time: 2019-10-10
Author: henry.ehrenberg@outlook.com
File Name: snorkel/labeling/apply/dask.py
Class Name: DaskLFApplier
Method Name: apply


Project Name: deepchem/deepchem
Commit Name: 763f8721952e8042d6086b103deb2450334be4b3
Time: 2017-03-09
Author: lilleswing@gmail.com
File Name: scripts/dock_dude.py
Class Name:
Method Name: prepare_ligands