                                (go (solver-loop solver out-chan abort-chan)))
             ::commands/abort (>!! abort-chan true)
             :default (warn "Unknown command:" command))
-          (recur (<! in-chan)))))))+          (recur (<! in-chan)))))))

(defn create-initial-solving [solver]
  (let [net (create-start-net solver)
        train-opts (get-initial-train-opts solver)
        trained-net (trainer/train net (get-train-entries solver) train-opts)
        mutation (first (m/identity-mutations net))
        [train-cost test-cost train-ca test-ca] (calc-metrics solver trained-net)
        case (commands/->SolvingCase trained-net mutation train-cost test-cost train-ca test-ca)]
    (commands/->Solving net
                        train-opts
                        (:mutation-opts solver)

(defn- calc-static-metrics
  [solver net iter-count]
  (let [train-e (get-train-entries solver)
        test-e (get-test-entries solver)
        train-opts (assoc (:train-opts solver) :iter-count iter-count)
        [_ results] (trainer/train net train-e train-opts #(calc-metrics % train-e test-e))]
    (for [metrics-serie (transpose results)]
      (into {} (for [[i val] (map-indexed vector metrics-serie)]
                 [(inc i) val])))))
