\yarn format\ pass

This commit is contained in:
Quinn Dougherty 2022-06-20 08:51:34 -04:00
parent f5366540f7
commit d156b24fd1
3 changed files with 19 additions and 10 deletions

View File

@ -164,8 +164,11 @@ module Score = {
)
| (Score_Dist(esti'), Score_Dist(answ'), Some(Ok(PSDist(prior'')))) =>
twoDists(~toPointSetFn, esti', answ')->E.R2.fmap(((esti'', answ'')) =>
{estimate: esti'', answer: answ'', prior: Some(prior'')}
->PointSetDist_Scoring.DistEstimateDistAnswer
{
estimate: esti'',
answer: answ'',
prior: Some(prior''),
}->PointSetDist_Scoring.DistEstimateDistAnswer
)
| (Score_Dist(_), _, Some(Ok(PSScalar(_)))) => DistributionTypes.Unreachable->Error
| (Score_Dist(esti'), Score_Scalar(answ'), None) =>
@ -177,19 +180,20 @@ module Score = {
| (Score_Dist(esti'), Score_Scalar(answ'), Some(Ok(PSDist(prior'')))) =>
toPointSetFn(esti')->E.R.bind(esti'' =>
{estimate: esti'', answer: answ', prior: Some(prior'')}
->PointSetDist_Scoring.DistEstimateScalarAnswer
-> Ok
->PointSetDist_Scoring.DistEstimateScalarAnswer
->Ok
)
| (Score_Scalar(esti'), Score_Dist(answ'), None) =>
toPointSetFn(answ')->E.R.bind(answ'' =>
{estimate: esti', answer: answ'', prior: None}
->PointSetDist_Scoring.ScalarEstimateDistAnswer
-> Ok
->PointSetDist_Scoring.ScalarEstimateDistAnswer
->Ok
)
| (Score_Scalar(esti'), Score_Dist(answ'), Some(Ok(PSScalar(prior'')))) =>
toPointSetFn(answ')->E.R.bind(answ'' =>
{estimate: esti', answer: answ'', prior: Some(prior'')}
->PointSetDist_Scoring.ScalarEstimateDistAnswer->Ok
->PointSetDist_Scoring.ScalarEstimateDistAnswer
->Ok
)
| (Score_Scalar(_), _, Some(Ok(PSDist(_)))) => DistributionTypes.Unreachable->Error
| (Score_Scalar(esti'), Score_Scalar(answ'), None) =>

View File

@ -172,8 +172,10 @@ module TwoScalars = {
}
}
let twoGenericDistsToTwoPointSetDists = (~toPointSetFn, estimate, answer): result<(pointSetDist, pointSetDist), 'e> =>
E.R.merge(toPointSetFn(estimate, ()), toPointSetFn(answer, ()))
let twoGenericDistsToTwoPointSetDists = (~toPointSetFn, estimate, answer): result<
(pointSetDist, pointSetDist),
'e,
> => E.R.merge(toPointSetFn(estimate, ()), toPointSetFn(answer, ()))
let logScore = (args: scoreArgs, ~combineFn, ~integrateFn, ~toMixedFn): result<
float,

View File

@ -223,7 +223,10 @@ let dispatchToGenericOutput = (
| ("normalize", [EvDistribution(dist)]) => Helpers.toDistFn(Normalize, dist, ~env)
| ("klDivergence", [EvDistribution(estimate), EvDistribution(answer)]) =>
Some(
DistributionOperation.run(FromDist(ToScore(LogScore(Score_Dist(answer), None)), estimate), ~env),
DistributionOperation.run(
FromDist(ToScore(LogScore(Score_Dist(answer), None)), estimate),
~env,
),
)
| ("klDivergence", [EvDistribution(estimate), EvDistribution(answer), EvDistribution(prior)]) =>
Some(