From 751220482cd2d880d7600edc87480ce59fd4eafe Mon Sep 17 00:00:00 2001 From: Maria Knorps Date: Tue, 4 Oct 2022 16:08:50 +0200 Subject: [PATCH 1/6] Maria/website adjustments (#201) * Start working on site * Fix formatting * revert flake.nix * clean up the PR files * Do not change flake.lock --- .envrc | 3 +- monad-bayes-site/_site/about.html | 19 ++++-- monad-bayes-site/_site/css/syntax.css | 62 ++++++++++++++++++ monad-bayes-site/_site/examples.html | 1 + .../{ => _site}/images/ezgif-3-1920267e5d.gif | Bin .../{ => _site}/images/ezgif-3-f3ddcd7da9.gif | Bin .../{ => _site}/images/measurement.gif | Bin monad-bayes-site/_site/tutorials.html | 1 + monad-bayes-site/about.md | 14 +++- monad-bayes-site/monad-bayes-site.cabal | 1 + monad-bayes-site/site.hs | 21 +++++- monad-bayes-site/stack.yaml | 3 + monad-bayes-site/templates/default.html | 1 + 13 files changed, 117 insertions(+), 9 deletions(-) create mode 100644 monad-bayes-site/_site/css/syntax.css rename monad-bayes-site/{ => _site}/images/ezgif-3-1920267e5d.gif (100%) rename monad-bayes-site/{ => _site}/images/ezgif-3-f3ddcd7da9.gif (100%) rename monad-bayes-site/{ => _site}/images/measurement.gif (100%) diff --git a/.envrc b/.envrc index a7d4a4fe..fdd82ce5 100644 --- a/.envrc +++ b/.envrc @@ -1 +1,2 @@ -# use flake +# use_flake +use_nix diff --git a/monad-bayes-site/_site/about.html b/monad-bayes-site/_site/about.html index 9d3d5e8d..ec6e2c31 100644 --- a/monad-bayes-site/_site/about.html +++ b/monad-bayes-site/_site/about.html @@ -6,6 +6,7 @@ Monad-Bayes - +
@@ -24,15 +25,25 @@

Monad-Bayes is a library for probabilistic programming written in Haskell.

Define distributions as programs

-

Perform inference with a variety of standard methods, which you can extend

-

Integrate with arbitrary Haskell code like this because Monad-Bayes is just a library, not a separate language

+

Perform inference with a variety of standard methods

+

Integrate with Haskell code like this because Monad-Bayes is just a library, not a separate language

Example

-

-

model is a mixture of Gaussians, defined as a program. Its type Distribution Double shows that it is a distribution over reals. image is a program too: as its type shows, it is a distribution over plots. In particular, plots that arise from forming a 200 bin histogram out of 100000 iid draws from model. To sample from image, we simply write sampler image, with the result shown below:

+
model :: Distribution Double
+model = do
+     x <- bernoulli 0.5
+     normal (if x then (-3) else 3) 1
+
+image :: Distribution Plot
+image = fmap (plot . histogram 200) (replicateM 100000 model)
+
+sampler image
+

The program model is a mixture of Gaussians. Its type Distribution Double represents a distribution over reals. +image is a program too: as its type shows, it is a distribution over plots. In particular, plots that arise from forming a 200 bin histogram out of 100000 independent identically distributed (iid) draws from model. +To sample from image, we simply write sampler image, with the result shown below: