                            emissions))]
       {:label (clojure.string/join "|" (map #(format "%.3f%s"(get probs %) %)
                                             emissions))})))
-;; @@
-;; =>
-;;; {"type":"html","content":"<span class='clj-var'>#&#x27;pdfa/pdfa-edge-&gt;descriptor</span>","value":"#'pdfa/pdfa-edge->descriptor"}
-;; <=
-
-;; @@
+
 (defn view-pdfa [pdfa]
   (rhizome.viz/view-graph (pdfa-states pdfa)
                           (pdfa-edges pdfa)
                           :node->descriptor (pdfa-node->descriptor pdfa)
                           :edge->descriptor (pdfa-edge->descriptor pdfa)))
-;; @@
-;; =>
-;;; {"type":"html","content":"<span class='clj-var'>#&#x27;pdfa/view-pdfa</span>","value":"#'pdfa/view-pdfa"}
+
+(defn pdfa-image [pdfa]
+  (rhizome.viz/graph->image (pdfa-states pdfa)
+                          (pdfa-edges pdfa)
+                          :node->descriptor (pdfa-node->descriptor pdfa)
+                          :edge->descriptor (pdfa-edge->descriptor pdfa)))
+
+(defn view-top-n-pdfas [states n]
+  (let [top-n-states (take n (sort-by second > (vec (empirical-distribution (collect-results states)))))]
+    (mapv #(vector (image-view (pdfa-image (first %))) (second %)) top-n-states)))
+;; @@
+;; =>
+;;; {"type":"html","content":"<span class='clj-var'>#&#x27;pdfa/view-top-n-pdfas</span>","value":"#'pdfa/view-top-n-pdfas"}
 ;; <=
 
 ;; **

;; **

;; @@
(def torch-connection (start-torch-connection pdfa [(repeat 100 nil) alphabet] combine-observes-fn :tcp-endpoint "tcp://*:5555"))
;; @@

;; **
;;; Now, run 

                            states))]
    {:edges edges
     :probs probs}))

(defn pdfa-states [pdfa]
  (keys (:edges pdfa)))

