Formatted code
This commit is contained in:
parent
4853df39bb
commit
d8b1e0d5ff
|
@ -192,12 +192,10 @@ module Score = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let logScore = (
|
let logScore = (~estimate: t, ~answer: genericDistOrScalar, ~prior: option<t>, ~env: env): result<
|
||||||
~estimate: t,
|
float,
|
||||||
~answer: genericDistOrScalar,
|
error,
|
||||||
~prior: option<t>,
|
> =>
|
||||||
~env: env,
|
|
||||||
): result<float, error> =>
|
|
||||||
argsMake(~esti=estimate, ~answ=answer, ~prior, ~env)->E.R.bind(x =>
|
argsMake(~esti=estimate, ~answ=answer, ~prior, ~env)->E.R.bind(x =>
|
||||||
x->PointSetDist.logScore->E.R2.errMap(y => DistributionTypes.OperationError(y))
|
x->PointSetDist.logScore->E.R2.errMap(y => DistributionTypes.OperationError(y))
|
||||||
)
|
)
|
||||||
|
|
|
@ -32,7 +32,7 @@ module Score: {
|
||||||
~estimate: t,
|
~estimate: t,
|
||||||
~answer: DistributionTypes.DistributionOperation.genericDistOrScalar,
|
~answer: DistributionTypes.DistributionOperation.genericDistOrScalar,
|
||||||
~prior: option<t>,
|
~prior: option<t>,
|
||||||
~env: env
|
~env: env,
|
||||||
) => result<float, error>
|
) => result<float, error>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,10 @@ module Prepare = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let twoDist = (values: ts): result<(DistributionTypes.genericDist, DistributionTypes.genericDist), err> => {
|
let twoDist = (values: ts): result<
|
||||||
|
(DistributionTypes.genericDist, DistributionTypes.genericDist),
|
||||||
|
err,
|
||||||
|
> => {
|
||||||
switch values {
|
switch values {
|
||||||
| [FRValueDist(a1), FRValueDist(a2)] => Ok(a1, a2)
|
| [FRValueDist(a1), FRValueDist(a2)] => Ok(a1, a2)
|
||||||
| _ => Error(impossibleError)
|
| _ => Error(impossibleError)
|
||||||
|
@ -95,8 +98,10 @@ module Prepare = {
|
||||||
let twoDistOrNumber = (values: ts): result<(frValueDistOrNumber, frValueDistOrNumber), err> =>
|
let twoDistOrNumber = (values: ts): result<(frValueDistOrNumber, frValueDistOrNumber), err> =>
|
||||||
values->ToValueArray.Record.twoArgs->E.R.bind(twoDistOrNumber)
|
values->ToValueArray.Record.twoArgs->E.R.bind(twoDistOrNumber)
|
||||||
|
|
||||||
let twoDist = (values: ts): result<(DistributionTypes.genericDist, DistributionTypes.genericDist), err> =>
|
let twoDist = (values: ts): result<
|
||||||
values->ToValueArray.Record.twoArgs->E.R.bind(twoDist)
|
(DistributionTypes.genericDist, DistributionTypes.genericDist),
|
||||||
|
err,
|
||||||
|
> => values->ToValueArray.Record.twoArgs->E.R.bind(twoDist)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -144,8 +149,7 @@ module Prepare = {
|
||||||
module Process = {
|
module Process = {
|
||||||
module DistOrNumberToDist = {
|
module DistOrNumberToDist = {
|
||||||
module Helpers = {
|
module Helpers = {
|
||||||
let toSampleSet = (r, env: GenericDist.env) =>
|
let toSampleSet = (r, env: GenericDist.env) => GenericDist.toSampleSetDist(r, env.sampleCount)
|
||||||
GenericDist.toSampleSetDist(r, env.sampleCount)
|
|
||||||
|
|
||||||
let mapFnResult = r =>
|
let mapFnResult = r =>
|
||||||
switch r {
|
switch r {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user