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) Ok(0.0)
} else { } else {
combinePointwise( combinePointwise(
PointSetDist_Scoring.KLDivergence.logScore(~eps=MagicNumbers.Epsilon.seven), PointSetDist_Scoring.KLDivergence.logScore(~eps=MagicNumbers.Epsilon.ten),
base, base,
reference, reference,
) )

View File

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

View File

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