tweak: Pass off to Quinn
This commit is contained in:
parent
4df4597ed3
commit
599c14b32c
|
@ -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,
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user