tweak: Pass off to Quinn

This commit is contained in:
NunoSempere 2022-05-11 12:39:03 -04:00
parent 4df4597ed3
commit 599c14b32c
2 changed files with 6 additions and 3 deletions

View File

@ -272,7 +272,10 @@ module T = Dist({
XYShape.Analysis.getVarianceDangerously(t, mean, Analysis.getMeanOfSquares) XYShape.Analysis.getVarianceDangerously(t, mean, Analysis.getMeanOfSquares)
let klDivergence = (prediction: t, answer: t) => { let klDivergence = (prediction: t, answer: t) => {
let enrichedAnswer = XYShape.PointwiseCombination.enrichXyShape(answer.xyShape) // answer.xyShape // let enrich = true
let enrichedAnswer = enrich
? XYShape.PointwiseCombination.enrichXyShape(answer.xyShape)
: answer.xyShape //
let newShape = XYShape.PointwiseCombination.combineAlongSupportOfSecondArgument( let newShape = XYShape.PointwiseCombination.combineAlongSupportOfSecondArgument(
PointSetDist_Scoring.KLDivergence.integrand, PointSetDist_Scoring.KLDivergence.integrand,
prediction.xyShape, prediction.xyShape,

View File

@ -482,13 +482,13 @@ module PointwiseCombination = {
result result
} }
let newXsUnflattened = Js.Array.mapi((x, i) => let newXsUnflattened = Js.Array.mapi((x, i) =>
switch i < length - 1 { switch i < length - 2 {
| true => getInBetween(x, t.xs[i + 1]) | true => getInBetween(x, t.xs[i + 1])
| false => [x] | false => [x]
} }
, t.xs) , t.xs)
let newXs = Belt.Array.concatMany(newXsUnflattened) let newXs = Belt.Array.concatMany(newXsUnflattened)
let newYs = E.A.fmap(x => XtoY.linear(x, t), newXs) //XtoY.linear(newXs) let newYs = E.A.fmap(x => XtoY.linear(x, t), newXs)
{xs: newXs, ys: newYs} {xs: newXs, ys: newYs}
} }
// This function is used for klDivergence // This function is used for klDivergence