Some sorta klDivergence conclusion

Value: [1e-6 to 1e-3]
This commit is contained in:
Quinn Dougherty 2022-05-04 14:55:49 -04:00
parent 898547f3a3
commit 6211d3cfb0
3 changed files with 3 additions and 8 deletions

View File

@ -281,7 +281,7 @@ module T = Dist({
Ok(0.0)
} else {
combinePointwise(
PointSetDist_Scoring.KLDivergence.logScore(~eps=MagicNumbers.Epsilon.seven),
PointSetDist_Scoring.KLDivergence.logScore(~eps=MagicNumbers.Epsilon.ten),
base,
reference,
)

View File

@ -6,7 +6,7 @@ module KLDivergence = {
if a == 0.0 {
Error(Operation.NegativeInfinityError)
} else if b == 0.0 {
Error(Operation.DivisionByZeroError)
Ok(b)
} else {
let quot = a /. b
quot < 0.0 ? Error(Operation.ComplexNumberError) : Ok(b *. logFn(quot))

View File

@ -164,12 +164,7 @@ module Scale = {
| #Multiply => Ok(a *. b)
| #Divide => divide(a, b)
| #Power => power(a, b)
| #Logarithm =>
if a < MagicNumbers.Epsilon.ten {
Error(NegativeInfinityError)
} else {
logarithm(a, b)
}
| #Logarithm => logarithm(a, b)
| #LogarithmWithThreshold(eps) =>
if a < eps {
Ok(0.0)