From 50deb4ef89b2f1c1a719d518736969537e61157d Mon Sep 17 00:00:00 2001 From: NunoSempere Date: Thu, 25 May 2023 16:47:40 -0700 Subject: [PATCH] save copy of results. --- README.md | 15 +- outputs/aha.html | 572 +++++++++++++++++++++++++ outputs/aha.sh | 3 + {screenshots => outputs}/jit-bayes.png | Bin src/compute_constrained_bayes | Bin 182760 -> 182760 bytes 5 files changed, 586 insertions(+), 4 deletions(-) create mode 100644 outputs/aha.html create mode 100644 outputs/aha.sh rename {screenshots => outputs}/jit-bayes.png (100%) diff --git a/README.md b/README.md index 17499ad..fb28754 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Models of Bayesian-like updating under constrained compute This repository contains some implementations of models of bayesian-like updating under constrained compute. The world in which these models operate is the set of sequences from the [Online Encyclopedia of Integer Sequences](https://oeis.org/), which can be downloaded from [here](https://oeis.org/wiki/JSON_Format,_Compressed_Files). -![](./screenshots/jit-bayes.png) +![](./outputs/jit-bayes.png) ## Models @@ -87,19 +87,26 @@ Why nim? Because it is nice to use and [freaking fast](https://github.com/NunoSe ### Prerequisites -Install [nim](https://nim-lang.org/install.html) and make. - -### Compilation +Install [nim](https://nim-lang.org/install.html) and make. Then: ``` git clone https://git.nunosempere.com/personal/compute-constrained-bayes.git cd compute-constrained-bayes cd src make deps ## get dependencies +``` + +### Compilation + +``` make fast ## also make, or make build, for compiling it with debug info. ./compute-constrained-bayes ``` +### Alternatively: + +See [here](./outputs/aha.html) for a copy of the program's outputs. + ## Contributions Contributions are very welcome, particularly around: diff --git a/outputs/aha.html b/outputs/aha.html new file mode 100644 index 0000000..188e4a7 --- /dev/null +++ b/outputs/aha.html @@ -0,0 +1,572 @@ + + + + + + +stdin + + +
+$ unbuffer make run | aha > aha.html
+./compute_constrained_bayes --verbosity:0
+
+## Full prediction with access to all hypotheses (~Solomonoff)
+## Initial sequence: @["1", "2", "3"]
+continuation_probabilities=@[
+  ("4", 0.5031144781144781),
+  ("5", 0.1727272727272727),
+  ("6", 0.07878787878787878),
+  ("2", 0.0505050505050505),
+  ("3", 0.04882154882154882),
+  ("7", 0.02803030303030303),
+  ("1", 0.02474747474747475),
+  ("8", 0.02163299663299663),
+  ("9", 0.01060606060606061),
+  ("10", 0.009175084175084175),
+  ("11", 0.008838383838383838),
+  ("12", 0.008501683501683501),
+  ("16", 0.003787878787878788),
+  ("14", 0.003787878787878788),
+  ("0", 0.003282828282828283),
+  ("15", 0.00260942760942761),
+  ("13", 0.002525252525252525),
+  ("18", 0.001262626262626263),
+  ("20", 0.001178451178451178),
+  ("17", 0.001178451178451178),
+  ("23", 0.000925925925925926),
+  ("24", 0.0008417508417508417),
+  ("22", 0.0008417508417508417),
+  ("41", 0.0007575757575757576),
+  ("28", 0.0006734006734006734),
+  ("19", 0.0005892255892255892),
+  ("211", 0.0005050505050505051),
+  ("29", 0.0004208754208754209),
+  ("30", 0.0004208754208754209),
+  ("26", 0.0003367003367003367),
+  ("35", 0.0003367003367003367),
+  ("25", 0.0003367003367003367),
+  ("4567", 0.0003367003367003367),
+  ("-2", 0.0003367003367003367),
+  ("-1", 0.0003367003367003367),
+  ("-4", 0.0002525252525252525),
+  ("40", 0.0002525252525252525),
+  ("60", 0.0002525252525252525),
+  ("32", 0.0002525252525252525),
+  ("81", 0.0001683501683501684),
+  ("64", 0.0001683501683501684),
+  ("38", 0.0001683501683501684),
+  ("56", 0.0001683501683501684),
+  ("33", 0.0001683501683501684),
+  ("31", 0.0001683501683501684),
+  ("123", 0.0001683501683501684),
+  ("69", 0.0001683501683501684),
+  ("27", 0.0001683501683501684),
+  ("39", 0.0001683501683501684),
+  ("128", 8.417508417508418e-05),
+  ("130", 8.417508417508418e-05),
+  ("55", 8.417508417508418e-05),
+  ("47", 8.417508417508418e-05),
+  ("65", 8.417508417508418e-05),
+  ("74", 8.417508417508418e-05),
+  ("83", 8.417508417508418e-05),
+  ("92", 8.417508417508418e-05),
+  ("124", 8.417508417508418e-05),
+  ("36", 8.417508417508418e-05),
+  ("789", 8.417508417508418e-05),
+  ("2436", 8.417508417508418e-05),
+  ("401", 8.417508417508418e-05),
+  ("43", 8.417508417508418e-05),
+  ("58", 8.417508417508418e-05),
+  ("34", 8.417508417508418e-05),
+  ("107", 8.417508417508418e-05),
+  ("380", 8.417508417508418e-05),
+  ("-3", 8.417508417508418e-05),
+  ("119", 8.417508417508418e-05),
+  ("456", 8.417508417508418e-05),
+  ("8787", 8.417508417508418e-05),
+  ("48", 8.417508417508418e-05),
+  ("127", 8.417508417508418e-05),
+  ("469", 8.417508417508418e-05),
+  ("57", 8.417508417508418e-05),
+  ("85", 8.417508417508418e-05),
+  ("617", 8.417508417508418e-05),
+  ("-16", 8.417508417508418e-05),
+  ("1080", 8.417508417508418e-05),
+  ("72", 8.417508417508418e-05),
+  ("95", 8.417508417508418e-05),
+  ("101", 8.417508417508418e-05),
+  ("661", 8.417508417508418e-05),
+  ("37", 8.417508417508418e-05),
+  ("2310", 8.417508417508418e-05),
+  ("62", 8.417508417508418e-05),
+  ("111213", 8.417508417508418e-05),
+  ("44", 8.417508417508418e-05),
+  ("99", 8.417508417508418e-05),
+  ("1767", 8.417508417508418e-05),
+  ("123543", 8.417508417508418e-05),
+  ("173", 8.417508417508418e-05),
+  ("21", 8.417508417508418e-05),
+  ("42", 8.417508417508418e-05),
+  ("144689999986441", 8.417508417508418e-05),
+  ("54", 8.417508417508418e-05),
+  ("512", 8.417508417508418e-05),
+  ("371", 8.417508417508418e-05),
+  ("52", 8.417508417508418e-05)
+]
+
+## Predictions with increasingly many hypotheses
+Showing predictions with increasingly many hypotheses after seeing @["1", "2", "3", "23"]
+Predictions with 10% of the hypotheses
+predictions=@[]
+Predictions with 20% of the hypotheses
+predictions=@[("49", 0.5), ("323", 0.5)]
+Predictions with 30% of the hypotheses
+predictions=@[("49", 0.3333333333333333), ("323", 0.3333333333333333), ("17", 0.3333333333333333)]
+Predictions with 40% of the hypotheses
+predictions=@[("49", 0.25), ("323", 0.25), ("17", 0.25), ("20880467999847912034355032910540", 0.25)]
+Predictions with 50% of the hypotheses
+predictions=@[("49", 0.25), ("323", 0.25), ("17", 0.25), ("20880467999847912034355032910540", 0.25)]
+Predictions with 60% of the hypotheses
+predictions=@[("49", 0.2), ("323", 0.2), ("17", 0.2), ("20880467999847912034355032910540", 0.2), ("59", 0.2)]
+Predictions with 70% of the hypotheses
+predictions=@[("49", 0.2), ("323", 0.2), ("17", 0.2), ("20880467999847912034355032910540", 0.2), ("59", 0.2)]
+Predictions with 80% of the hypotheses
+predictions=@[
+  ("49", 0.125),
+  ("323", 0.125),
+  ("17", 0.125),
+  ("20880467999847912034355032910540", 0.125),
+  ("59", 0.125),
+  ("29", 0.125),
+  ("19", 0.125),
+  ("5", 0.125)
+]
+Predictions with 90% of the hypotheses
+predictions=@[
+  ("49", 0.125),
+  ("323", 0.125),
+  ("17", 0.125),
+  ("20880467999847912034355032910540", 0.125),
+  ("59", 0.125),
+  ("29", 0.125),
+  ("19", 0.125),
+  ("5", 0.125)
+]
+Predictions with 100% of the hypotheses
+predictions=@[
+  ("49", 0.09090909090909091),
+  ("323", 0.09090909090909091),
+  ("17", 0.09090909090909091),
+  ("20880467999847912034355032910540", 0.09090909090909091),
+  ("59", 0.09090909090909091),
+  ("29", 0.09090909090909091),
+  ("19", 0.09090909090909091),
+  ("5", 0.09090909090909091),
+  ("31", 0.09090909090909091),
+  ("11", 0.09090909090909091),
+  ("43", 0.09090909090909091)
+]
+
+## Prediction with limited number of hypotheses (~JIT-Bayes)
+### Prediction after seeing 3 observations: @["1", "2", "3"]
+predictions=@[
+  ("4", 0.375),
+  ("5", 0.25),
+  ("6", 0.2083333333333333),
+  ("8", 0.04166666666666666),
+  ("10", 0.04166666666666666),
+  ("3", 0.04166666666666666),
+  ("7", 0.04166666666666666)
+]
+Correct continuation, 23 not found in set of hypotheses of size 1000/362901. Increasing size of the set of hypotheses.
+Correct continuation, 23 not found in set of hypotheses of size 31000/362901. Increasing size of the set of hypotheses.
+Increased number of hypotheses to 61000, and found 1 concordant hypotheses. Continuing
+### Prediction after seeing 4 observations: @["1", "2", "3", "23"]
+predictions=@[("49", 1.0)]
+Correct continuation, 11 not found in set of hypotheses of size 61000/362901. Increasing size of the set of hypotheses.
+Correct continuation, 11 not found in set of hypotheses of size 91000/362901. Increasing size of the set of hypotheses.
+Correct continuation, 11 not found in set of hypotheses of size 121000/362901. Increasing size of the set of hypotheses.
+Correct continuation, 11 not found in set of hypotheses of size 151000/362901. Increasing size of the set of hypotheses.
+Correct continuation, 11 not found in set of hypotheses of size 181000/362901. Increasing size of the set of hypotheses.
+Correct continuation, 11 not found in set of hypotheses of size 211000/362901. Increasing size of the set of hypotheses.
+Correct continuation, 11 not found in set of hypotheses of size 241000/362901. Increasing size of the set of hypotheses.
+Correct continuation, 11 not found in set of hypotheses of size 271000/362901. Increasing size of the set of hypotheses.
+Correct continuation, 11 not found in set of hypotheses of size 301000/362901. Increasing size of the set of hypotheses.
+Increased number of hypotheses to 331000, and found 1 concordant hypotheses. Continuing
+### Prediction after seeing 5 observations: @["1", "2", "3", "23", "11"]
+predictions=@[("18", 1.0)]
+Correct continuation was 18
+It was assigned a probability of 1.0
+### Prediction after seeing 6 observations: @["1", "2", "3", "23", "11", "18"]
+predictions=@[("77", 1.0)]
+Correct continuation was 77
+It was assigned a probability of 1.0
+### Prediction after seeing 7 observations: @["1", "2", "3", "23", "11", "18", "77"]
+predictions=@[("46", 1.0)]
+Correct continuation was 46
+It was assigned a probability of 1.0
+### Prediction after seeing 8 observations: @["1", "2", "3", "23", "11", "18", "77", "46"]
+predictions=@[("84", 1.0)]
+Correct continuation was 84
+It was assigned a probability of 1.0
+
+## Mini-infra-bayesianism over environments, where your utility in an environment is just the log-loss in the predictions you make until you become certain that you are in that environment.
+### Prediction after seeing 3 observations: @["1", "2", "3"]
+predictions=@[
+  ("4", 0.5031144781144781),
+  ("5", 0.1727272727272727),
+  ("6", 0.07878787878787878),
+  ("2", 0.0505050505050505),
+  ("3", 0.04882154882154882),
+  ("7", 0.02803030303030303),
+  ("1", 0.02474747474747475),
+  ("8", 0.02163299663299663),
+  ("9", 0.01060606060606061),
+  ("10", 0.009175084175084175),
+  ("11", 0.008838383838383838),
+  ("12", 0.008501683501683501),
+  ("16", 0.003787878787878788),
+  ("14", 0.003787878787878788),
+  ("0", 0.003282828282828283),
+  ("15", 0.00260942760942761),
+  ("13", 0.002525252525252525),
+  ("18", 0.001262626262626263),
+  ("20", 0.001178451178451178),
+  ("17", 0.001178451178451178),
+  ("23", 0.000925925925925926),
+  ("24", 0.0008417508417508417),
+  ("22", 0.0008417508417508417),
+  ("41", 0.0007575757575757576),
+  ("28", 0.0006734006734006734),
+  ("19", 0.0005892255892255892),
+  ("211", 0.0005050505050505051),
+  ("29", 0.0004208754208754209),
+  ("30", 0.0004208754208754209),
+  ("26", 0.0003367003367003367),
+  ("35", 0.0003367003367003367),
+  ("25", 0.0003367003367003367),
+  ("4567", 0.0003367003367003367),
+  ("-2", 0.0003367003367003367),
+  ("-1", 0.0003367003367003367),
+  ("-4", 0.0002525252525252525),
+  ("40", 0.0002525252525252525),
+  ("60", 0.0002525252525252525),
+  ("32", 0.0002525252525252525),
+  ("81", 0.0001683501683501684),
+  ("64", 0.0001683501683501684),
+  ("38", 0.0001683501683501684),
+  ("56", 0.0001683501683501684),
+  ("33", 0.0001683501683501684),
+  ("31", 0.0001683501683501684),
+  ("123", 0.0001683501683501684),
+  ("69", 0.0001683501683501684),
+  ("27", 0.0001683501683501684),
+  ("39", 0.0001683501683501684),
+  ("128", 8.417508417508418e-05),
+  ("130", 8.417508417508418e-05),
+  ("55", 8.417508417508418e-05),
+  ("47", 8.417508417508418e-05),
+  ("65", 8.417508417508418e-05),
+  ("74", 8.417508417508418e-05),
+  ("83", 8.417508417508418e-05),
+  ("92", 8.417508417508418e-05),
+  ("124", 8.417508417508418e-05),
+  ("36", 8.417508417508418e-05),
+  ("789", 8.417508417508418e-05),
+  ("2436", 8.417508417508418e-05),
+  ("401", 8.417508417508418e-05),
+  ("43", 8.417508417508418e-05),
+  ("58", 8.417508417508418e-05),
+  ("34", 8.417508417508418e-05),
+  ("107", 8.417508417508418e-05),
+  ("380", 8.417508417508418e-05),
+  ("-3", 8.417508417508418e-05),
+  ("119", 8.417508417508418e-05),
+  ("456", 8.417508417508418e-05),
+  ("8787", 8.417508417508418e-05),
+  ("48", 8.417508417508418e-05),
+  ("127", 8.417508417508418e-05),
+  ("469", 8.417508417508418e-05),
+  ("57", 8.417508417508418e-05),
+  ("85", 8.417508417508418e-05),
+  ("617", 8.417508417508418e-05),
+  ("-16", 8.417508417508418e-05),
+  ("1080", 8.417508417508418e-05),
+  ("72", 8.417508417508418e-05),
+  ("95", 8.417508417508418e-05),
+  ("101", 8.417508417508418e-05),
+  ("661", 8.417508417508418e-05),
+  ("37", 8.417508417508418e-05),
+  ("2310", 8.417508417508418e-05),
+  ("62", 8.417508417508418e-05),
+  ("111213", 8.417508417508418e-05),
+  ("44", 8.417508417508418e-05),
+  ("99", 8.417508417508418e-05),
+  ("1767", 8.417508417508418e-05),
+  ("123543", 8.417508417508418e-05),
+  ("173", 8.417508417508418e-05),
+  ("21", 8.417508417508418e-05),
+  ("42", 8.417508417508418e-05),
+  ("144689999986441", 8.417508417508418e-05),
+  ("54", 8.417508417508418e-05),
+  ("512", 8.417508417508418e-05),
+  ("371", 8.417508417508418e-05),
+  ("52", 8.417508417508418e-05)
+]
+Correct continuation was 23
+It was assigned a probability of 0.000925925925925926
+And hence a loss of -6.984716320118265
+Total loss is: -6.984716320118265
+### Prediction after seeing 4 observations: @["1", "2", "3", "23"]
+predictions=@[
+  ("49", 0.09090909090909091),
+  ("323", 0.09090909090909091),
+  ("17", 0.09090909090909091),
+  ("20880467999847912034355032910540", 0.09090909090909091),
+  ("59", 0.09090909090909091),
+  ("29", 0.09090909090909091),
+  ("19", 0.09090909090909091),
+  ("5", 0.09090909090909091),
+  ("31", 0.09090909090909091),
+  ("11", 0.09090909090909091),
+  ("43", 0.09090909090909091)
+]
+Correct continuation was 11
+It was assigned a probability of 0.09090909090909091
+And hence a loss of -2.397895272798371
+Total loss is: -9.382611592916636
+### Prediction after seeing 5 observations: @["1", "2", "3", "23", "11"]
+predictions=@[("18", 1.0)]
+Correct continuation was 18
+It was assigned a probability of 1.0
+And hence a loss of 0.0
+Total loss is: -9.382611592916636
+### Prediction after seeing 6 observations: @["1", "2", "3", "23", "11", "18"]
+predictions=@[("77", 1.0)]
+Correct continuation was 77
+It was assigned a probability of 1.0
+And hence a loss of 0.0
+Total loss is: -9.382611592916636
+### Prediction after seeing 7 observations: @["1", "2", "3", "23", "11", "18", "77"]
+predictions=@[("46", 1.0)]
+Correct continuation was 46
+It was assigned a probability of 1.0
+And hence a loss of 0.0
+Total loss is: -9.382611592916636
+### Prediction after seeing 8 observations: @["1", "2", "3", "23", "11", "18", "77", "46"]
+predictions=@[("84", 1.0)]
+Correct continuation was 84
+It was assigned a probability of 1.0
+And hence a loss of 0.0
+Total loss is: -9.382611592916636
+
+## Mini-infra-bayesianism over environments, where your utility in an environment is just the log-loss in the predictions you make until you become certain that you are in that environment. This time with a twist: You don't have hypotheses over the sequences you observe, but rather over their odd and even position, i.e., you think that you observe interleaved OEIS sequences, (a1, b1, a2, b2, a3, b3). See the README.md for more.
+### Prediction after seeing 6 observations: @["1", "2", "2", "11", "3", "13"]
+predictions=@[
+  ("4", 0.5031144781144781),
+  ("5", 0.1727272727272727),
+  ("6", 0.07878787878787878),
+  ("2", 0.0505050505050505),
+  ("3", 0.04882154882154882),
+  ("7", 0.02803030303030303),
+  ("1", 0.02474747474747475),
+  ("8", 0.02163299663299663),
+  ("9", 0.01060606060606061),
+  ("10", 0.009175084175084175),
+  ("11", 0.008838383838383838),
+  ("12", 0.008501683501683501),
+  ("16", 0.003787878787878788),
+  ("14", 0.003787878787878788),
+  ("0", 0.003282828282828283),
+  ("15", 0.00260942760942761),
+  ("13", 0.002525252525252525),
+  ("18", 0.001262626262626263),
+  ("20", 0.001178451178451178),
+  ("17", 0.001178451178451178),
+  ("23", 0.000925925925925926),
+  ("24", 0.0008417508417508417),
+  ("22", 0.0008417508417508417),
+  ("41", 0.0007575757575757576),
+  ("28", 0.0006734006734006734),
+  ("19", 0.0005892255892255892),
+  ("211", 0.0005050505050505051),
+  ("29", 0.0004208754208754209),
+  ("30", 0.0004208754208754209),
+  ("26", 0.0003367003367003367),
+  ("35", 0.0003367003367003367),
+  ("25", 0.0003367003367003367),
+  ("4567", 0.0003367003367003367),
+  ("-2", 0.0003367003367003367),
+  ("-1", 0.0003367003367003367),
+  ("-4", 0.0002525252525252525),
+  ("40", 0.0002525252525252525),
+  ("60", 0.0002525252525252525),
+  ("32", 0.0002525252525252525),
+  ("81", 0.0001683501683501684),
+  ("64", 0.0001683501683501684),
+  ("38", 0.0001683501683501684),
+  ("56", 0.0001683501683501684),
+  ("33", 0.0001683501683501684),
+  ("31", 0.0001683501683501684),
+  ("123", 0.0001683501683501684),
+  ("69", 0.0001683501683501684),
+  ("27", 0.0001683501683501684),
+  ("39", 0.0001683501683501684),
+  ("128", 8.417508417508418e-05),
+  ("130", 8.417508417508418e-05),
+  ("55", 8.417508417508418e-05),
+  ("47", 8.417508417508418e-05),
+  ("65", 8.417508417508418e-05),
+  ("74", 8.417508417508418e-05),
+  ("83", 8.417508417508418e-05),
+  ("92", 8.417508417508418e-05),
+  ("124", 8.417508417508418e-05),
+  ("36", 8.417508417508418e-05),
+  ("789", 8.417508417508418e-05),
+  ("2436", 8.417508417508418e-05),
+  ("401", 8.417508417508418e-05),
+  ("43", 8.417508417508418e-05),
+  ("58", 8.417508417508418e-05),
+  ("34", 8.417508417508418e-05),
+  ("107", 8.417508417508418e-05),
+  ("380", 8.417508417508418e-05),
+  ("-3", 8.417508417508418e-05),
+  ("119", 8.417508417508418e-05),
+  ("456", 8.417508417508418e-05),
+  ("8787", 8.417508417508418e-05),
+  ("48", 8.417508417508418e-05),
+  ("127", 8.417508417508418e-05),
+  ("469", 8.417508417508418e-05),
+  ("57", 8.417508417508418e-05),
+  ("85", 8.417508417508418e-05),
+  ("617", 8.417508417508418e-05),
+  ("-16", 8.417508417508418e-05),
+  ("1080", 8.417508417508418e-05),
+  ("72", 8.417508417508418e-05),
+  ("95", 8.417508417508418e-05),
+  ("101", 8.417508417508418e-05),
+  ("661", 8.417508417508418e-05),
+  ("37", 8.417508417508418e-05),
+  ("2310", 8.417508417508418e-05),
+  ("62", 8.417508417508418e-05),
+  ("111213", 8.417508417508418e-05),
+  ("44", 8.417508417508418e-05),
+  ("99", 8.417508417508418e-05),
+  ("1767", 8.417508417508418e-05),
+  ("123543", 8.417508417508418e-05),
+  ("173", 8.417508417508418e-05),
+  ("21", 8.417508417508418e-05),
+  ("42", 8.417508417508418e-05),
+  ("144689999986441", 8.417508417508418e-05),
+  ("54", 8.417508417508418e-05),
+  ("512", 8.417508417508418e-05),
+  ("371", 8.417508417508418e-05),
+  ("52", 8.417508417508418e-05)
+]
+Correct continuation was 23
+It was assigned a probability of 0.000925925925925926
+And hence a loss of -6.984716320118265
+Total loss is: -6.984716320118265
+### Prediction after seeing 7 observations: @["1", "2", "2", "11", "3", "13", "23"]
+predictions=@[
+  ("17", 0.4035087719298245),
+  ("19", 0.1228070175438596),
+  ("23", 0.1228070175438596),
+  ("29", 0.07017543859649122),
+  ("31", 0.07017543859649122),
+  ("24", 0.03508771929824561),
+  ("7", 0.03508771929824561),
+  ("101", 0.03508771929824561),
+  ("41", 0.03508771929824561),
+  ("47", 0.01754385964912281),
+  ("20", 0.01754385964912281),
+  ("22", 0.01754385964912281),
+  ("25", 0.01754385964912281)
+]
+Correct continuation was 23
+It was assigned a probability of 0.1228070175438596
+And hence a loss of -2.097141118779237
+Total loss is: -9.081857438897501
+### Prediction after seeing 8 observations: @["1", "2", "2", "11", "3", "13", "23", "23"]
+predictions=@[
+  ("49", 0.09090909090909091),
+  ("323", 0.09090909090909091),
+  ("17", 0.09090909090909091),
+  ("20880467999847912034355032910540", 0.09090909090909091),
+  ("59", 0.09090909090909091),
+  ("29", 0.09090909090909091),
+  ("19", 0.09090909090909091),
+  ("5", 0.09090909090909091),
+  ("31", 0.09090909090909091),
+  ("11", 0.09090909090909091),
+  ("43", 0.09090909090909091)
+]
+Correct continuation was 11
+It was assigned a probability of 0.09090909090909091
+And hence a loss of -2.397895272798371
+Total loss is: -11.47975271169587
+### Prediction after seeing 9 observations: @["1", "2", "2", "11", "3", "13", "23", "23", "11"]
+predictions=@[
+  ("29", 0.2857142857142857),
+  ("41", 0.2857142857142857),
+  ("37", 0.1428571428571428),
+  ("31", 0.1428571428571428),
+  ("47", 0.1428571428571428)
+]
+Correct continuation was 47
+It was assigned a probability of 0.1428571428571428
+And hence a loss of -1.945910149055313
+Total loss is: -13.42566286075118
+### Prediction after seeing 10 observations: @["1", "2", "2", "11", "3", "13", "23", "23", "11", "47"]
+predictions=@[("18", 1.0)]
+Correct continuation was 18
+It was assigned a probability of 1.0
+And hence a loss of 0.0
+Total loss is: -13.42566286075118
+### Prediction after seeing 11 observations: @["1", "2", "2", "11", "3", "13", "23", "23", "11", "47", "18"]
+predictions=@[("59", 1.0)]
+Correct continuation was 59
+It was assigned a probability of 1.0
+And hence a loss of 0.0
+Total loss is: -13.42566286075118
+### Prediction after seeing 12 observations: @["1", "2", "2", "11", "3", "13", "23", "23", "11", "47", "18", "59"]
+predictions=@[("77", 1.0)]
+Correct continuation was 77
+It was assigned a probability of 1.0
+And hence a loss of 0.0
+Total loss is: -13.42566286075118
+### Prediction after seeing 13 observations: @["1", "2", "2", "11", "3", "13", "23", "23", "11", "47", "18", "59", "77"]
+predictions=@[("71", 1.0)]
+Correct continuation was 71
+It was assigned a probability of 1.0
+And hence a loss of 0.0
+Total loss is: -13.42566286075118
+### Prediction after seeing 14 observations: @["1", "2", "2", "11", "3", "13", "23", "23", "11", "47", "18", "59", "77", "71"]
+predictions=@[("46", 1.0)]
+Correct continuation was 46
+It was assigned a probability of 1.0
+And hence a loss of 0.0
+Total loss is: -13.42566286075118
+### Prediction after seeing 15 observations: @["1", "2", "2", "11", "3", "13", "23", "23", "11", "47", "18", "59", "77", "71", "46"]
+predictions=@[("83", 1.0)]
+Correct continuation was 83
+It was assigned a probability of 1.0
+And hence a loss of 0.0
+Total loss is: -13.42566286075118
+### Prediction after seeing 16 observations: @["1", "2", "2", "11", "3", "13", "23", "23", "11", "47", "18", "59", "77", "71", "46", "83"]
+predictions=@[("84", 1.0)]
+Correct continuation was 84
+It was assigned a probability of 1.0
+And hence a loss of 0.0
+Total loss is: -13.42566286075118
+### Prediction after seeing 17 observations: @["1", "2", "2", "11", "3", "13", "23", "23", "11", "47", "18", "59", "77", "71", "46", "83", "84"]
+predictions=@[("107", 1.0)]
+Correct continuation was 107
+It was assigned a probability of 1.0
+And hence a loss of 0.0
+Total loss is: -13.42566286075118
+
+
+ + diff --git a/outputs/aha.sh b/outputs/aha.sh new file mode 100644 index 0000000..f105dda --- /dev/null +++ b/outputs/aha.sh @@ -0,0 +1,3 @@ +unbuffer make run | aha > aha.html +# where aha is https://github.com/theZiz/aha + diff --git a/screenshots/jit-bayes.png b/outputs/jit-bayes.png similarity index 100% rename from screenshots/jit-bayes.png rename to outputs/jit-bayes.png diff --git a/src/compute_constrained_bayes b/src/compute_constrained_bayes index 9fb4943d4a7132d0ea2003c402dbbdcf5a38b800..0c523dcddc44c718a747e0bc71a60b29d00eba98 100755 GIT binary patch delta 3127 zcmY+G4Nz3q8HVq$X}_JeCxZUMud%+(wZpzLKvuibdjpJl`mmi(kvhO(IJq z$(59D`MW0ZTahd$of6gJh&*})FizV{vS@DRog~z13bB<*yim$VD)X?9_OHN&*r-!Db!m+;96$*cA#}m&zZ(n)F zG0mD#$zx^8z#BsGCAW?mx9S|bFz@9&8uObMh77}+uw^W+k$j{DJo-*B-w*EeU8k|o zWVo2nMP4)-obW373G#RoUqSvJdGGz;csqF|d8LV`kr$I^I!%U+Mgfg)MuH37dmTKR z{B08-AWtTL%EZr;k0T%YA-GNh`OsR%0X5zi%(c~vhH`Yi#ati$EAntVM?5A;^#^CqC zckCkXB7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