Introduction to Anglican Jan-Willem van de Meent
Anatomy of an Anglican Program (ns examples.one-flip (:use [anglican.core :exclude [-main]] [anglican emit runtime stat]) (:gen-class)) (defquery one-flip [outcome] (let [theta (sample (beta 5 3))] (observe (flip theta) outcome) (> theta 0.7))) (defn -main [& args] (let[samples (doquery :rmh one-flip [true])] (prn (frequencies (map :result (take 1000 samples))))))
Anatomy of an Anglican Program Namespace (ns examples.one-flip (:use [anglican.core :exclude [-main]] declaration [anglican emit runtime stat]) (:gen-class)) (defquery one-flip [outcome] (let [theta (sample (beta 5 3))] (observe (flip theta) outcome) (> theta 0.7))) (defn -main [& args] (let[samples (doquery :rmh one-flip [true])] (prn (frequencies (map :result (take 1000 samples))))))
Anatomy of an Anglican Program Namespace (ns examples.one-flip (:use [anglican.core :exclude [-main]] declaration [anglican emit runtime stat]) (:gen-class)) (defquery one-flip [outcome] (let [theta (sample (beta 5 3))] (observe (flip theta) outcome) (> theta 0.7))) (defn -main [& args] (let[samples (doquery :rmh one-flip [true])] (prn (frequencies (map :result (take 1000 samples))))))
Anatomy of an Anglican Program Namespace (ns examples.one-flip (:use [anglican.core :exclude [-main]] declaration [anglican emit runtime stat]) (:gen-class)) (defquery one-flip [outcome] (let [theta (sample (beta 5 3))] (observe (flip theta) outcome) (> theta 0.7))) (defn -main [& args] (let[samples (doquery :rmh one-flip [true])] (prn (frequencies (map :result (take 1000 samples))))))
Anatomy of an Anglican Program (ns examples.one-flip (:use [anglican.core :exclude [-main]] [anglican emit runtime stat]) (:gen-class)) Anglican (defquery one-flip [outcome] program (let [theta (sample (beta 5 3))] (observe (flip theta) outcome) (> theta 0.7))) (defn -main [& args] (let[samples (doquery :rmh one-flip [true])] (prn (frequencies (map :result (take 1000 samples))))))
Anatomy of an Anglican Program (ns examples.one-flip (:use [anglican.core :exclude [-main]] [anglican emit runtime stat]) (:gen-class)) (defquery one-flip Name [outcome] (let [theta (sample (beta 5 3))] (observe (flip theta) outcome) (> theta 0.7))) (defn -main [& args] (let[samples (doquery :rmh one-flip [true])] (prn (frequencies (map :result (take 1000 samples))))))
Anatomy of an Anglican Program (ns examples.one-flip (:use [anglican.core :exclude [-main]] [anglican emit runtime stat]) (:gen-class)) (defquery one-flip Arguments [outcome] (let [theta (sample (beta 5 3))] (observe (flip theta) outcome) (> theta 0.7))) (defn -main [& args] (let[samples (doquery :rmh one-flip [true])] (prn (frequencies (map :result (take 1000 samples))))))
Anatomy of an Anglican Program (ns examples.one-flip (:use [anglican.core :exclude [-main]] [anglican emit runtime stat]) (:gen-class)) (defquery one-flip [outcome] (let [theta (sample (beta 5 3))] (observe (flip theta) outcome) Return value (> theta 0.7))) (defn -main [& args] (let[samples (doquery :rmh one-flip [true])] (prn (frequencies (map :result (take 1000 samples))))))
Anatomy of an Anglican Program (ns examples.one-flip (:use [anglican.core :exclude [-main]] [anglican emit runtime stat]) (:gen-class)) (defquery one-flip [outcome] Distributions (let [theta (sample (beta 5 3))] (observe (flip theta) outcome) (> theta 0.7))) (defn -main [& args] (let[samples (doquery :rmh one-flip [true])] (prn (frequencies (map :result (take 1000 samples))))))
Anatomy of an Anglican Program (ns examples.one-flip (:use [anglican.core :exclude [-main]] [anglican emit runtime stat]) (:gen-class)) (defquery one-flip [outcome] Generate a (let [theta (sample (beta 5 3))] (observe (flip theta) outcome) random value (> theta 0.7))) (defn -main [& args] (let[samples (doquery :rmh one-flip [true])] (prn (frequencies (map :result (take 1000 samples))))))
Anatomy of an Anglican Program (ns examples.one-flip (:use [anglican.core :exclude [-main]] [anglican emit runtime stat]) (:gen-class)) (defquery one-flip [outcome] Condition (let [theta (sample (beta 5 3))] (observe (flip theta) outcome) on a value (> theta 0.7))) (defn -main [& args] (let[samples (doquery :rmh one-flip [true])] (prn (frequencies (map :result (take 1000 samples))))))
Anatomy of an Anglican Program (ns examples.one-flip (:use [anglican.core :exclude [-main]] [anglican emit runtime stat]) (:gen-class)) (defquery one-flip [outcome] (let [theta (sample (beta 5 3))] (observe (flip theta) outcome) (> theta 0.7))) (defn -main [& args] Lazy (let[samples (doquery :rmh one-flip [true])] (prn (frequencies sequence (map :result of samples (take 1000 samples))))))
Anatomy of an Anglican Program (ns examples.one-flip (:use [anglican.core :exclude [-main]] [anglican emit runtime stat]) (:gen-class)) (defquery one-flip [outcome] (let [theta (sample (beta 5 3))] (observe (flip theta) outcome) (> theta 0.7))) (defn -main [& args] Inference (let[samples (doquery :rmh one-flip [true])] (prn (frequencies method (map :result (take 1000 samples))))))
Anatomy of an Anglican Program (ns examples.one-flip (:use [anglican.core :exclude [-main]] [anglican emit runtime stat]) (:gen-class)) (defquery one-flip [outcome] (let [theta (sample (beta 5 3))] (observe (flip theta) outcome) (> theta 0.7))) (defn -main [& args] Anglican (let[samples (doquery :rmh one-flip [true])] (prn (frequencies query (map :result (take 1000 samples))))))
Anatomy of an Anglican Program (ns examples.one-flip (:use [anglican.core :exclude [-main]] [anglican emit runtime stat]) (:gen-class)) (defquery one-flip [outcome] (let [theta (sample (beta 5 3))] (observe (flip theta) outcome) (> theta 0.7))) (defn -main [& args] Argument (let[samples (doquery :rmh one-flip [true])] (prn (frequencies values (map :result (take 1000 samples))))))
Anatomy of an Anglican Program (ns examples.one-flip (:use [anglican.core :exclude [-main]] [anglican emit runtime stat]) (:gen-class)) (defquery one-flip [outcome] (let [theta (sample (beta 5 3))] (observe (flip theta) outcome) (> theta 0.7))) (defn -main [& args] Argument (let[samples (doquery :rmh one-flip [true])] (prn (frequencies values (map :result (take 1000 samples))))))
Anatomy of an Anglican Program (ns examples.one-flip (:use [anglican.core :exclude [-main]] [anglican emit runtime stat]) (:gen-class)) (defquery one-flip [outcome] (let [theta (sample (beta 5 3))] (observe (flip theta) outcome) (> theta 0.7))) (defn -main [& args] (let[samples (doquery :rmh one-flip [true])] (prn (frequencies Analysis (map :result (take 1000 samples))))))
Anatomy of an Anglican Program (ns examples.one-flip (:use [anglican.core :exclude [-main]] [anglican emit runtime stat]) (:gen-class)) (defquery one-flip [outcome] (let [theta (sample (beta 5 3))] (observe (flip theta) outcome) (> theta 0.7))) (defn -main [& args] (let[samples (doquery :rmh one-flip [true])] (prn (frequencies Analysis (map :result (take 1000 samples))))))
Anatomy of an Anglican Program (ns examples.one-flip (:use [anglican.core :exclude [-main]] [anglican emit runtime stat]) (:gen-class)) (defquery one-flip [outcome] (let [theta (sample (beta 5 3))] (observe (flip theta) outcome) (> theta 0.7))) (defn -main [& args] (let[samples (doquery :rmh one-flip [true])] (prn (frequencies Analysis (map :result (take 1000 samples))))))
How do I run this? (ns examples.one-flip (:use [anglican.core :exclude [-main]] [anglican emit runtime stat]) (:gen-class)) (defquery one-flip [outcome] (let [theta (sample (beta 5 3))] (observe (flip theta) outcome) (> theta 0.7))) (defn -main [& args] (let[samples (doquery :rmh one-flip [true])] (prn (frequencies (map :result (take 1000 samples))))))
Recommend
More recommend