step: use "showPredictionsWithIncreasinglyManyHypotheses" func.

This commit is contained in:
NunoSempere 2023-05-24 17:25:49 -07:00
parent 7dbd689548
commit 98d982066c
3 changed files with 20 additions and 0 deletions

Binary file not shown.

View File

@ -103,6 +103,7 @@ proc predictContinuationWithTruncatedHypotheses(seqs: seq[seq[string]], start: s
return predictContinuation(truncated_seqs, start)
proc showPredictionsWithMoreHypotheses(seqs: seq[seq[string]], start: seq[string]) =
echo "Showing predictions with increasingly many hypotheses after seeing ", start
let l = seqs.len
for i in 1..10:
let n = (l.float * (i.float/10.0)).int
@ -179,6 +180,11 @@ let continuation_probabilities = predictContinuation(seqs, observations)
print continuation_probabilities
echo ""
echo "## Predictions with increasingly many hypotheses"
observations = @["1", "2", "3", "23"]
showPredictionsWithMoreHypotheses(seqs, observations)
echo ""
observations = @["1", "2", "3", "23", "11", "18", "77", "46", "84"]
jitBayesLoop(seqs, observations, 3, 1_000, 2_000)

View File

@ -1,15 +1,29 @@
## make
## make = make build
## make deps
## make build
## make fast ## < recommended for users
## make run
## make examine
## make time
SHELL := /bin/bash ## <= required to use time
VERBOSE=--verbosity:0
build: compute_constrained_bayes.nim
nim c $(VERBOSE) compute_constrained_bayes.nim
fast:
nim c $(VERBOSE) -d:danger compute_constrained_bayes.nim && echo
deps:
nimble install print@1.0.2
gzip -d ../data/stripped.gz -c > ../data/stripped
run: compute_constrained_bayes
./compute_constrained_bayes $(VERBOSE)
## Misc:
examine: compute_constrained_bayes
nim c $(VERBOSE) compute_constrained_bayes.nim && time ./compute_constrained_bayes $(VERBOSE) && echo
nim c $(VERBOSE) -d:release compute_constrained_bayes.nim && time ./compute_constrained_bayes $(VERBOSE) && echo