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)
 | 
			
		||||
 | 
			
		||||
  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,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user