         temp-answer (core/output network)
         loss (cp/loss loss-fn temp-answer answer)
         loss-gradient (cp/loss-gradient loss-fn temp-answer answer)]
-    (core/backward network input loss-gradient)))
+    (core/backward (assoc network :loss loss) input loss-gradient)))
 
 (defn test-train-step
   []

    (core/stack-module network-modules)))


(defn create-sgd-optimizer
  [network]
  (opt/sgd-optimiser (core/parameter-count network) {:learn-rate learning-rate :momentum momentum}))


(defn train-step

                          (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)))

