Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
REMOVE logloss content directly
Browse files Browse the repository at this point in the history
  • Loading branch information
tqchen committed Sep 28, 2015
1 parent e335a26 commit f623a5b
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions python/mxnet/metric.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,26 +54,6 @@ def update(self, label, pred):
self.sum_metric += numpy.sum(pred_label == label)
self.num_inst += label.size

# pylint: disable=pointless-string-statement
"""
class LogLoss(EvalMetric):
# remove because it because it is too slow
def __init__(self):
self.eps = 1e-15
super(LogLoss, self).__init__('logloss')
def update(self, label, pred):
# pylint: disable=invalid-name
pred = pred.asnumpy()
label = label.asnumpy().astype('int32')
for i in range(label.size):
p = pred[i][label[i]]
assert(numpy.isnan(p) == False)
p = max(min(p, 1 - self.eps), self.eps)
self.sum_metric += -numpy.log(p)
self.num_inst += label.size
"""
# pylint: enable=pointless-string-statement

class CustomMetric(EvalMetric):
"""Custom evaluation metric that takes a NDArray function.
Expand Down

0 comments on commit f623a5b

Please sign in to comment.