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)
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(
PointSetDist_Scoring.KLDivergence.integrand,
prediction.xyShape,

View File

@ -482,13 +482,13 @@ module PointwiseCombination = {
result
}
let newXsUnflattened = Js.Array.mapi((x, i) =>
switch i < length - 1 {
switch i < length - 2 {
| true => getInBetween(x, t.xs[i + 1])
| false => [x]
}
, t.xs)
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}
}
// This function is used for klDivergence