Changed Ok(0) to Error(NegativeInfinityError).

Value: [1e-7 to 1e-5]
This commit is contained in:
Quinn Dougherty 2022-05-04 11:59:46 -04:00
parent 32f141abdc
commit 683439c7e5
2 changed files with 7 additions and 5 deletions

View File

@ -239,9 +239,11 @@ module T = Dist({
if referenceIsZero { if referenceIsZero {
Ok(0.0) Ok(0.0)
} else { } else {
combinePointwise(~fn=PointSetDist_Scoring.KLDivergence.logScore, base, reference) |> E.R2.bind( combinePointwise(
integralEndYResult, ~fn=PointSetDist_Scoring.KLDivergence.logScore,
) base,
reference,
) |> E.R2.bind(integralEndYResult)
} }
} }
}) })

View File

@ -157,8 +157,8 @@ module Scale = {
| #Divide => divide(a, b) | #Divide => divide(a, b)
| #Power => power(a, b) | #Power => power(a, b)
| #Logarithm => | #Logarithm =>
if a < MagicNumbers.Epsilon.seven { if a < MagicNumbers.Epsilon.ten {
Ok(0.0) Error(NegativeInfinityError)
} else { } else {
logarithm(a, b) logarithm(a, b)
} }