step: use "showPredictionsWithIncreasinglyManyHypotheses" func.
This commit is contained in:
parent
7dbd689548
commit
98d982066c
Binary file not shown.
|
@ -103,6 +103,7 @@ proc predictContinuationWithTruncatedHypotheses(seqs: seq[seq[string]], start: s
|
||||||
return predictContinuation(truncated_seqs, start)
|
return predictContinuation(truncated_seqs, start)
|
||||||
|
|
||||||
proc showPredictionsWithMoreHypotheses(seqs: seq[seq[string]], start: seq[string]) =
|
proc showPredictionsWithMoreHypotheses(seqs: seq[seq[string]], start: seq[string]) =
|
||||||
|
echo "Showing predictions with increasingly many hypotheses after seeing ", start
|
||||||
let l = seqs.len
|
let l = seqs.len
|
||||||
for i in 1..10:
|
for i in 1..10:
|
||||||
let n = (l.float * (i.float/10.0)).int
|
let n = (l.float * (i.float/10.0)).int
|
||||||
|
@ -179,6 +180,11 @@ let continuation_probabilities = predictContinuation(seqs, observations)
|
||||||
print continuation_probabilities
|
print continuation_probabilities
|
||||||
echo ""
|
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"]
|
observations = @["1", "2", "3", "23", "11", "18", "77", "46", "84"]
|
||||||
jitBayesLoop(seqs, observations, 3, 1_000, 2_000)
|
jitBayesLoop(seqs, observations, 3, 1_000, 2_000)
|
||||||
|
|
||||||
|
|
14
src/makefile
14
src/makefile
|
@ -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
|
SHELL := /bin/bash ## <= required to use time
|
||||||
VERBOSE=--verbosity:0
|
VERBOSE=--verbosity:0
|
||||||
|
|
||||||
build: compute_constrained_bayes.nim
|
build: compute_constrained_bayes.nim
|
||||||
nim c $(VERBOSE) compute_constrained_bayes.nim
|
nim c $(VERBOSE) compute_constrained_bayes.nim
|
||||||
|
|
||||||
|
fast:
|
||||||
|
nim c $(VERBOSE) -d:danger compute_constrained_bayes.nim && echo
|
||||||
|
|
||||||
deps:
|
deps:
|
||||||
nimble install print@1.0.2
|
nimble install print@1.0.2
|
||||||
|
gzip -d ../data/stripped.gz -c > ../data/stripped
|
||||||
|
|
||||||
run: compute_constrained_bayes
|
run: compute_constrained_bayes
|
||||||
./compute_constrained_bayes $(VERBOSE)
|
./compute_constrained_bayes $(VERBOSE)
|
||||||
|
|
||||||
|
## Misc:
|
||||||
examine: compute_constrained_bayes
|
examine: compute_constrained_bayes
|
||||||
nim c $(VERBOSE) compute_constrained_bayes.nim && time ./compute_constrained_bayes $(VERBOSE) && echo
|
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
|
nim c $(VERBOSE) -d:release compute_constrained_bayes.nim && time ./compute_constrained_bayes $(VERBOSE) && echo
|
||||||
|
|
Loading…
Reference in New Issue
Block a user