Skip to content

Commit

Permalink
Added KLDiv loss in loss functions. (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashok93 authored and bfortuner committed Oct 12, 2019
1 parent bd6362f commit 3511539
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion code/loss_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@ def Huber(yHat, y, delta=1.):


def KLDivergence(yHat, y):
pass
"""
:param yHat:
:param y:
:return: KLDiv(yHat || y)
"""
return np.sum(yHat * np.log((yHat / y)))


def L1(yHat, y):
Expand Down

0 comments on commit 3511539

Please sign in to comment.