 The rational for creating a matrix instead of a sequence of rows is to provide a hint to
 the underlying implementation to store the data contiguously as we will be accessing it
 in order repeatedly"
-  [interleaved-input-vector width height k-width k-height padx pady stride-w stride-h]
-  (let [width (long width)
-        height (long height)
-        num-items (long (first (m/shape interleaved-input-vector)))
-        num-channels (long (/ num-items (* width height)))
-        k-width (long k-width)
-        k-height (long k-height)
-        padx (long padx)
-        pady (long pady)
-        stride-w (long stride-w)
-        stride-h (long stride-h)
-        input-matrix (create-padded-input-matrix interleaved-input-vector
-                                                 width height
-                                                 padx pady
-                                                 num-channels)
+  [interleaved-input-vector {:keys [^long width ^long height ^long k-width ^long k-height
+                                    ^long padx ^long pady ^long stride-w ^long stride-h
+                                    ^long num-channels] :as conv-layer-config }]
+  (let [input-matrix (create-padded-input-matrix interleaved-input-vector
+                                                 conv-layer-config)
         output-width (get-padded-strided-dimension width padx k-width stride-w)
         output-height (get-padded-strided-dimension height pady k-height stride-h)
         input-mat-stride (* (+ width (* 2 padx)) num-channels)
         kernel-stride (* k-width num-channels)]
     ;;I go ahead and create a contiguous matrix here because we will iterate over this many times
-    (m/array :vectorz (convolution-sequence input-matrix output-width output-height k-width k-height
-                                            stride-w stride-h num-channels))))
+    (m/array :vectorz (convolution-sequence input-matrix output-width output-height
+                                            conv-layer-config))))
 
 (defn convolution-forward
   [weights bias input-convolved-rows]




(defrecord Convolutional [weights bias width height padx pady k-width k-height
                          stride-w stride-h output weight-gradient bias-gradient]
    cp/PModule
    (cp/calc [this input]
      (let [input-convolved-rows (create-convolution-rows input width height k-width k-height
                                                          padx pady stride-w stride-h)
            backpass-input (columnar-sum input-convolved-rows)
            output (convolution-forward weights bias input-convolved-rows)]
        [output backpass-input]))



(defn convolution-sequence
  "Produce a sequence of views that performs a convolution over an input matrix"
  [input-matrix output-width output-height {:keys [^long k-width ^long k-height
                                                   ^long stride-w ^long stride-h
                                                   ^long num-channels]
                                            :as conv-layer-config}]
  (let [kernel-stride (* k-width num-channels)]
    (for [^long output-y (range output-height)
          ^long output-x (range output-width)]
      (m/as-vector (m/submatrix input-matrix [[(* output-y stride-h) k-height]
                                              [(* output-x stride-w num-channels) kernel-stride]])))))


(defn create-convolution-rows
