 
 (defn plot-network-tsne
   [net-key & {:keys [sample-count iterations]
-              :or {sample-count 2500
+              :or {sample-count 10000
                    iterations 1000}}]
   (let [_ (println "running network" net-key)
         samples (run-network net-key)

                      (desc/linear->logistic 144 :l2-max-constraint 2.0)
                      (desc/dropout 0.5)
                      (desc/linear 784)]]
    (build-and-create-network network-desc)))


(defn train-and-evaluate
  [network optimiser {:keys [dataset cv-dataset] :as train-config}]
  (let [n-epochs 20
        batch-size 10
        loss-fn (opt/mse-loss)
        full-train-config
        (merge train-config (gpu-train/make-training-config network optimiser loss-fn
                                                            batch-size n-epochs
                                                            dataset cv-dataset))

        train-config (dissoc full-train-config :gpu-cv-dataset)
        train-config (gpu-train/train-uploaded-train-config train-config)
        train-config (assoc train-config :gpu-cv-dataset (:gpu-cv-dataset full-train-config))
        loss (gpu-train/evaluate-training-network train-config)]
    {:network (vec (flatten (desc/network->description network)))
     :score loss}))


(defonce networks (atom nil))


(defn train-network
  [[network-entry opt-entry] train-config]
  (let [[net-name network-fn] network-entry
        [opt-name opt-fn] opt-entry
        network-and-score (train-and-evaluate (network-fn) (opt-fn) train-config)]
    (swap! networks assoc [net-name opt-name]
           network-and-score)))


                      (desc/linear->relu 144 :l2-max-constraint 2.0)
                      (desc/dropout 0.5)
                      (desc/linear 784)]]
    (single-target-network network-desc)))


(defn create-dropout-logistic-full
