Skip to content

Instantly share code, notes, and snippets.

@quinn-dougherty
Created May 20, 2022 17:21
Show Gist options
  • Select an option

  • Save quinn-dougherty/4be2257d132331bf1cfb864db3b06337 to your computer and use it in GitHub Desktop.

Select an option

Save quinn-dougherty/4be2257d132331bf1cfb864db3b06337 to your computer and use it in GitHub Desktop.
`logScore` organization proposal
// Needs to be able to import `PointSetTypes.pointSetDist` as `t`
type scoreArgs = DistDist(t, t) | DistFloat(t, float), DistDistDist(t, t, t), DistFloatDist(t, float, t)
// Can be expanded for the other 4 cases of the definition of scoring a scalar prediction against a dist answer.
module KlDivergence = {
...
}
module LogScoreAgainstScalarAnswer = {
let score = (prediction, answer) => ...
let scoreWithPrior = (prediction, answer, prior) => ...
}
module T = {
let score = (args: scoreArgs) =>
switch args {
DistDist(prediction, answer) => KlDivergence.score(prediction, answer)
DistFloat(prediction, answer) => LogScoreAgainstScalarAnswer.score(prediction, answer)
DistDistDist(prediction, answer, prior) => KlDivergence.score(prediction, answer) - KlDivergence.score(prior, answer)
DistFloatDist(prediction, answer, prior) => LogScoreAgainstScalarAnswer.scoreWithPrior(prediction, answer, prior)
}
}
@OAGr
Copy link

OAGr commented May 20, 2022

thanks!

@quinn-dougherty
Copy link
Author

me in slack:

the main change in philosophy is importing the type PoitnSetTypes.pointSetDist and it's constructors into the scoring file, instead of making the scoring file unaware

also:

  • I'll be moving integration logic into scoring file now, too.

@OAGr
Copy link

OAGr commented May 20, 2022

the main change in philosophy is importing the type PoitnSetTypes.pointSetDist and it's constructors into the scoring file, instead of making the scoring file unaware

I don't see much of that here, but I'm happy for the scoring file to be dependent on PoitnSetTypes.pointSetDist, if that's what you mean.

I'll be moving integration logic into scoring file now, too.
Moving lots to the scoring file seems good to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment