Some sorta klDivergence conclusion
Value: [1e-6 to 1e-3]
This commit is contained in:
parent
898547f3a3
commit
6211d3cfb0
|
@ -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,
|
||||
)
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user