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 {
Ok(0.0)
} else {
combinePointwise(~fn=PointSetDist_Scoring.KLDivergence.logScore, base, reference) |> E.R2.bind(
integralEndYResult,
)
combinePointwise(
~fn=PointSetDist_Scoring.KLDivergence.logScore,
base,
reference,
) |> E.R2.bind(integralEndYResult)
}
}
})

View File

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