     (core/stack-module network-modules)))
 
 
-(defn create-sgd-optimizer
+(defn create-optimizer
   [network]
-  (opt/sgd-optimiser (core/parameter-count network) {:learn-rate learning-rate :momentum momentum}))
+  (opt/adadelta-optimiser (core/parameter-count network))
+  ;(opt/sgd-optimiser (core/parameter-count network) {:learn-rate learning-rate :momentum momentum} )
+  )
 
 
 (defn train-step

(defn train
  []
  (let [network (create-network)
        optimizer (create-sgd-optimizer network)
        epoch-batches (repeatedly n-epochs
                       #(into [] (partition batch-size (shuffle (range (count training-data))))))
        [optimizer network] (reduce (fn [opt-network batch-index-seq]
                                      (reduce (fn [[optimizer network] batch-indexes]
                                                (let [input-seq (mapv training-data batch-indexes)
                                                      answer-seq (mapv training-labels batch-indexes)]
                                                  (train-batch input-seq answer-seq network optimizer loss-fn)))
                                              opt-network
                                              batch-index-seq))
                                    [optimizer network]

                          (train-step input answer network loss-fn))
                        network
                        (map vector input-seq label-seq))
        batch-scale (/ 10.0 (count input-seq))]
    (m/scale! (core/gradient network) batch-scale)
    (core/optimise optimizer network)))

