introduction to anglican
play

Introduction to Anglican Jan-Willem van de Meent Anatomy of an - PowerPoint PPT Presentation

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


  1. Introduction to Anglican Jan-Willem van de Meent

  2. 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))))))

  3. 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))))))

  4. 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))))))

  5. 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))))))

  6. 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))))))

  7. 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))))))

  8. 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))))))

  9. 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))))))

  10. 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))))))

  11. 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))))))

  12. 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))))))

  13. 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))))))

  14. 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))))))

  15. 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))))))

  16. 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))))))

  17. 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))))))

  18. 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))))))

  19. 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))))))

  20. 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))))))

  21. 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