Skip to content

Commit

Permalink
Merged in dtolpin/jburroni-anglican-examples (pull request #1)
Browse files Browse the repository at this point in the history
fixed spelling and coding errors
  • Loading branch information
dtolpin authored and jburroni committed Dec 18, 2017
2 parents 0a82f5c + 5f6766a commit b2e0be3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions worksheets/interventional.clj
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
;;;
;;; The operator contains three main components:
;;; 1. The actual macro: takes a query, the name of a variable and the value to use for the intervention. This value could be any arbitrary function as long as uses variables previously defined in the scope of the intervention.
;;; 1. A helper method to analyse the query looking for bindings (_let_ staments).
;;; 1. A helper method to analyse the query looking for bindings (_let_ statements).
;;; 1. A helper method to modify the bindings and apply the intervention.
;; **

Expand All @@ -51,7 +51,7 @@
1 (myself (nth code 1))
(let [[stament bindings & other] code]
(if (= stament 'let)
;TODO: use the undocumented detruscture method: http://clojure.org/guides/destructuring
;TODO: use the undocumented destructuring method: http://clojure.org/guides/destructuring
(let [new-bindings (parse-and-replace-let target-variable value bindings)
new-other (doall (for [element other] (myself element)))]
(cons stament (cons (vec new-bindings) new-other))) ;(cons new-bindings new-other)
Expand All @@ -74,8 +74,8 @@
;; @@

;; **
;;; ## Sprinkler bayesian network.
;;; This example is a very simple DAG that models the state of the weather (`is-cloudy`, `is-raning`), a sprinkler device (`sprinkler-dist`, `sprinkler`), and whether the grass is wet (`wet-grass-dist`) or not.
;;; ## Sprinkler Bayesian network.
;;; This example is a very simple DAG that models the state of the weather (`is-cloudy`, `is-raining`), a sprinkler device (`sprinkler-dist`, `sprinkler`), and whether the grass is wet (`wet-grass-dist`) or not.
;;;
;;; For this example, we are conditioning on the fact that the grass is wet, and querying the probability of raining.
;; **
Expand Down Expand Up @@ -218,7 +218,7 @@
;; @@

;; @@
(meta intervened-complex) :source
((meta intervened-complex) :source)
;; @@
;; =>
;;; {"type":"html","content":"<span class='clj-keyword'>:source</span>","value":":source"}
Expand Down

0 comments on commit b2e0be3

Please sign in to comment.