fixed paren balancing and so on

This commit is contained in:
Quinn Dougherty 2022-06-24 08:56:16 -04:00
parent 3e67180fe1
commit 9dbd4f076c

View File

@ -226,16 +226,22 @@ let dispatchToGenericOutput = (call: IEV.functionCall, env: DistributionOperatio
)->Some )->Some
| ("normalize", [IEvDistribution(dist)]) => Helpers.toDistFn(Normalize, dist, ~env) | ("normalize", [IEvDistribution(dist)]) => Helpers.toDistFn(Normalize, dist, ~env)
| ("klDivergence", [IEvDistribution(prediction), IEvDistribution(answer)]) => | ("klDivergence", [IEvDistribution(prediction), IEvDistribution(answer)]) =>
Some(DistributionOperation.run(FromDist(ToScore(LogScore(Score_Dist(answer), None), prediction), ~env)) Some(
DistributionOperation.run(
FromDist(ToScore(LogScore(Score_Dist(answer), None)), prediction),
~env,
),
)
| ( | (
"klDivergence", "klDivergence",
[IEvDistribution(prediction), IEvDistribution(answer), IEvDistribution(prior)], [IEvDistribution(prediction), IEvDistribution(answer), IEvDistribution(prior)],
) => ) =>
Some( Some(
DistributionOperation.run( DistributionOperation.run(
FromDist(ToScore(LogScore(Score_Dist(answer), Some(Score_Dist(prior)))), estimate), ~env FromDist(ToScore(LogScore(Score_Dist(answer), Some(Score_Dist(prior)))), prediction),
) ~env,
) ),
)
| ( | (
"logScoreWithPointAnswer", "logScoreWithPointAnswer",
[IEvDistribution(prediction), IEvNumber(answer), IEvDistribution(prior)], [IEvDistribution(prediction), IEvNumber(answer), IEvDistribution(prior)],
@ -249,7 +255,7 @@ let dispatchToGenericOutput = (call: IEV.functionCall, env: DistributionOperatio
], ],
) => ) =>
DistributionOperation.run( DistributionOperation.run(
FromDist(ToScore(LogScore(answer, prior->Some)), prediction), FromDist(ToScore(LogScore(Score_Scalar(answer), Score_Dist(prior)->Some)), prediction),
~env, ~env,
)->Some )->Some
| ("logScoreWithPointAnswer", [IEvDistribution(prediction), IEvNumber(answer)]) | ("logScoreWithPointAnswer", [IEvDistribution(prediction), IEvNumber(answer)])
@ -257,7 +263,10 @@ let dispatchToGenericOutput = (call: IEV.functionCall, env: DistributionOperatio
"logScoreWithPointAnswer", "logScoreWithPointAnswer",
[IEvDistribution(prediction), IEvDistribution(Symbolic(#Float(answer)))], [IEvDistribution(prediction), IEvDistribution(Symbolic(#Float(answer)))],
) => ) =>
DistributionOperation.run(FromDist(ToScore(LogScore(answer, None)), prediction), ~env)->Some DistributionOperation.run(
FromDist(ToScore(LogScore(Score_Scalar(answer), None)), prediction),
~env,
)->Some
| ("isNormalized", [IEvDistribution(dist)]) => Helpers.toBoolFn(IsNormalized, dist, ~env) | ("isNormalized", [IEvDistribution(dist)]) => Helpers.toBoolFn(IsNormalized, dist, ~env)
| ("toPointSet", [IEvDistribution(dist)]) => Helpers.toDistFn(ToPointSet, dist, ~env) | ("toPointSet", [IEvDistribution(dist)]) => Helpers.toDistFn(ToPointSet, dist, ~env)
| ("scaleLog", [IEvDistribution(dist)]) => | ("scaleLog", [IEvDistribution(dist)]) =>