-
Notifications
You must be signed in to change notification settings - Fork 18
Description
I am trying to figure out how to correctly provide a list of initial points in BOPP. Am I overlooking something simple?
Here are the details. The doopt, the output of BOPP, and the defopt.
(def model (atom (lazy-seq (doopt :smc stochSIR [] 1
:speed-option :careful
;;
:bo-options {:verbose 2
:num-initial-points 2
:num-scaling-thetas 1000
:debug-folder true
:initial-points [{:intro_day 35, :intro_duration 1, :distancing 0.6322107370456067, :beta_b 0.05537357023136269, :beta_bS 0.19621440146596547, :beta_lice 0.16614719314835572, :beta_p 0.16744317384178953}]
}))))
And from the output I get before the thing crashes is that BOPP doesn't like the format I use for initial-points. One, it reformats the map into a collcetion of [keyword values], and two, it drops the last keyword-value pair ({:beta_p 0.16744317384178953} in this case)
:intial-points ([:intro_day 35] [:intro_duration 1] [:distancing 0.6322107370456067] [:beta_b 0.05537357023136269] [:beta_bS 0.19621440146596547] [:beta_lice 0.16614719314835572] {:intro_day 32, :intro_duration 1, :distancing 1.024606244767797, :beta_b 0.06818428961187084, :beta_bS 0.1391747830274707, :beta_lice 0.14780650814426455, :beta_p 0.27853257654947244}
If I do not specify any initial points, BOPP runs fine, and feeds the run-epidemic function with the sampled maps of priors that the run-epidemic function expects.
(anglican.emit/with-primitive-procedures
[run-epidemic]
(defopt stochSIR [] [intro_day intro_duration distancing beta_b beta_bS beta_lice beta_p]
(let [intro_day (sample (uniform-discrete 30 80))
intro_duration (sample (uniform-discrete 0 5))
distancing (sample (uniform-continuous 0.5 1.3))
beta_b (sample (uniform-continuous 0 0.1))
beta_bS (sample (uniform-continuous 0 0.3))
beta_lice (sample (uniform-continuous 0 0.3))
beta_p (sample (uniform-continuous 0 0.3))
_ (println {:intro_day intro_day :intro_duration intro_duration :distancing distancing :beta_b beta_b :beta_bS beta_bS :beta_lice beta_lice :beta_p beta_p})
epidemic-score (run-epidemic {:intro_day intro_day :intro_duration intro_duration :distancing distancing :beta_b beta_b :beta_bS beta_bS :beta_lice beta_lice :beta_p beta_p})]
;;
;; scores that are higher than (log 2) are due to the classifier neural network guessing worse than random. No need to give that bonus-points for guessing worse than random, so the peak score lies at (log 2)
(observe (normal (log 2) 0.1) (:score epidemic-score)))))