         ;; accumulate the latest gradient
         (m/add-scaled-product! msgrad gradient gradient decay-rate)
 
-        ;; compute the parameter update
+         ;; compute the parameter update
         (m/assign! dx msdx)
         (m/div! dx msgrad)
         (m/sqrt! dx)

  ([size]
    (let [msgrad (m/mutable (m/new-vector :vectorz size))
          msdx (m/mutable (m/new-vector :vectorz size))
          dx (m/mutable (m/new-vector :vectorz size))]
      (m/assign! msgrad 0.01)
      (m/assign! msdx 0.01)
      (m/assign! dx 0.0)
      (AdaDelta. msgrad msdx dx nil))))

(extend-protocol cp/PGradientOptimiser
  AdaDelta

                     msdx       ;; mean squared delta update
                     dx         ;; latest delta update
                     parameters ;; updated parameters
                     rms-g      ;; root mean squared gt
                     rms-dx     ;; root mean squared (delta x)t-1
                     ])

(defn adadelta-optimiser
