Hi Jeff,

good idea to move this over to clojure 1.3. I have just included your
patch.

On Nov 20, 5:32 am, Jeff Rose <ros...@gmail.com> wrote:
> Cool!  I experimented a little bit with Church a while back, but
> having something like this in Clojure could be really interesting.  I
> don't have much experience with sampling, but if I understand it
> correctly, your grass-is-wet demo is defining a belief network where
> each sample taken represents the complete state of the graph, or just
> the final outcome?  What does a sample look like?  It would be great
> if we could use this kind of generative model to create chord
> sequences, melodies, and rhythms for Overtone.  I don't know what
> kinds of choice points would be appropriate, or if we could train them
> based on a database of existing progressions?

The grass-is-wet demo indeed specifies a belief network. In contrast
to Church, the definition of the model, conditioning on observations
and specifying the output variables is all done in one path. This
works exactly like the probability monad in clojure.contrib. Thus,
each sample corresponds to an outcome of the output variables, i.e.
"rain" in the example. Since the model is conditioned on "grass-is-wet
= true", using m-zero of the monad implements rejection sampling, you
obtain samples of the posterior distribution p(rain | grass-is-wet =
true).
In principle it should be possible to use it for generative models of
music. Since I'm not an expert in this area, I don't know which kind
of models and probability distributions are useful to describe musical
structure. Let me know if you have an idea, I would be happy to help
putting it into clojure.

Best,

   Nils
> -Jeff
> On Nov 18, 12:57 am, Nils Bertschinger
>
> <nils.bertschin...@googlemail.com> wrote:
> > Hi everyone,
>
> > inspired by the bher compiler for the probabilistic scheme dialect MIT
> > Church, I have implemented a version of the probability monad which
> > uses Metropolis Hastings to draw samples from runs of monadic
> > programs. You can find the code on 
> > github:https://github.com/bertschi/ProbClojureNice.
>
> > The monadic version is more a proof of principle and not very fast. It
> > might nevertheless be useful, e.g. for educational purposes. Have a
> > look and decide for yourself ...
> > For the future, I'm working on a different approach to embed
> > probabilistic operations into clojure which scales better and allows
> > to run somewhat larger models.
>
> > Any comments and feedback are welcome. Best,
>
> >     Nils
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to