bitten: update bitten.py
This commit is contained in:
parent
191bdec97d
commit
3f5f1276c1
1 changed files with 1 additions and 1 deletions
|
@ -262,7 +262,7 @@ class Accuracy(AbstractError):
|
||||||
|
|
||||||
|
|
||||||
class Crossentropy(AbstractError):
|
class Crossentropy(AbstractError):
|
||||||
def crossentropy(self, predictions, eps=1e-6):
|
def _compute(self, predictions, eps=1e-6):
|
||||||
p, t = np.clip(predictions, eps, 1 - eps), self.outputs
|
p, t = np.clip(predictions, eps, 1 - eps), self.outputs
|
||||||
f = np.sum(-t * np.log(p) - (1 - t) * np.log(1 - p), axis=-1)
|
f = np.sum(-t * np.log(p) - (1 - t) * np.log(1 - p), axis=-1)
|
||||||
return np.mean(f)
|
return np.mean(f)
|
||||||
|
|
Loading…
Add table
Reference in a new issue