Commit 37e664f8 authored by Yuxin Wu's avatar Yuxin Wu

fix performance regression

parent c95292dc
...@@ -72,7 +72,8 @@ class ModelDesc(object): ...@@ -72,7 +72,8 @@ class ModelDesc(object):
def get_gradient_processor(self): def get_gradient_processor(self):
""" Return a list of GradientProcessor. They will be executed in order""" """ Return a list of GradientProcessor. They will be executed in order"""
return [#SummaryGradient(), return [#SummaryGradient(),
CheckGradient()] #CheckGradient()
]
class ModelFromMetaGraph(ModelDesc): class ModelFromMetaGraph(ModelDesc):
......
...@@ -85,8 +85,7 @@ class BinaryStatistics(object): ...@@ -85,8 +85,7 @@ class BinaryStatistics(object):
:param pred: 0/1 np array :param pred: 0/1 np array
:param label: 0/1 np array of the same size :param label: 0/1 np array of the same size
""" """
nr = label.size assert pred.shape == label.shape
assert pred.size == label.size
self.nr_pos += (label == 1).sum() self.nr_pos += (label == 1).sum()
self.nr_neg += (label == 0).sum() self.nr_neg += (label == 0).sum()
self.nr_pred_pos += (pred == 1).sum() self.nr_pred_pos += (pred == 1).sum()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment