     (doall
      (map #(m/add! % input-gradient)
           (convolution-sequence input-matrix output-width output-height
-                                k-width k-height stride-w stride-h
-                                num-channels)))
+                                conv-layer-config)))
     (m/array :vectorz (m/as-vector input-mat-view))))
 
 
 (defn convolution-backward!
-  [output-gradient backpass-input weights bias weight-gradient bias-gradient
-   width height k-width k-height padx pady stride-w stride-h]
+  [output-gradient backpass-input weights bias weight-gradient bias-gradient conv-layer-config]
   (let [linear-output-gradient (gradient-vector-to-output-gradient output-gradient (m/row-count weights))
         linear-input backpass-input
         linear-input-gradient (linear-backward! linear-input linear-output-gradient weights
                                                 bias weight-gradient bias-gradient)]
     (linear-input-gradient-to-input-image linear-input-gradient
-                                          width height k-width k-height padx pady stride-w stride-h)))
-
-
-
+                                          conv-layer-config)))
 
 
 ;; Explanation of the the conv-layer algorithm:

    (reduce m/add! accumulator (rest rows))))


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Convolution layer forward pass utility functions
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defn create-padded-input-matrix
  [interleaved-input-vector width height padx pady num-channels]
  (let [width (long width)
        height (long height)
        padx (long padx)
        pady (long pady)
        num-channels (long num-channels)
        has-padding (or (> padx 0) (> pady 0))]
    (if has-padding
      (let [padded-input-matrix (m/zero-array :vectorz [(+ height (* 2 pady))
                                                        (* (+ width (* 2 padx)) num-channels)])

        (assoc this :output output :backpass-input backpass-input)))

    (backward [this input output-gradient]
      (assoc this :input-gradient (convolution-backward! output-gradient (:backpass-input this)
                                                         weights bias weight-gradient bias-gradient
                                                         conv-layer-config)))

    (input-gradient [this]
      (:input-gradient this))
