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

Commit 985a4ca

Browse files
goldmermaidsxjscience
authored andcommitted
Update KL Divergence formula (#16170)
* Update KL Divergence formula Errors fix. * remove initial error
1 parent 35ef45c commit 985a4ca

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

python/mxnet/gluon/loss.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ class KLDivLoss(Loss):
424424
425425
prob = \softmax({pred})
426426
427-
L = \sum_i {label}_i * \big[\log({label}_i) - log({pred}_i)\big]
427+
L = \sum_i {label}_i * \big[\log({label}_i) - \log({prob}_i)\big]
428428
429429
430430
`label` and `pred` can have arbitrary shape as long as they have the same

0 commit comments

Comments
 (0)