@@ -42,7 +42,7 @@ prop_im2col_c = once $
42 , 5.0, 6.0, 9.0, 10.0
42 , 5.0, 6.0, 9.0, 10.0
43 , 6.0, 7.0, 10.0, 11.0
43 , 6.0, 7.0, 10.0, 11.0
44 , 7.0, 8.0, 11.0, 12.0 ]
44 , 7.0, 8.0, 11.0, 12.0 ]
45− out = im2col_c 2 2 1 1 input
45+ out = im2col 2 2 1 1 input
46 in expected === out
46 in expected === out
48prop_im2col_stride = once $
48prop_im2col_stride = once $
@@ -68,7 +68,7 @@ prop_im2col_c_stride = once $
68 , 3.0, 4.0, 7.0, 8.0
68 , 3.0, 4.0, 7.0, 8.0
69 , 5.0, 6.0, 9.0, 10.0
69 , 5.0, 6.0, 9.0, 10.0
70 , 7.0, 8.0, 11.0, 12.0 ]
70 , 7.0, 8.0, 11.0, 12.0 ]
71− out = im2col_c 2 2 1 2 input
71+ out = im2col 2 2 1 2 input
72 in expected === out
72 in expected === out
74prop_im2col_other = once $
74prop_im2col_other = once $
@@ -90,12 +90,12 @@ prop_im2col_c_other = once $
90 expected = (2><6)
90 expected = (2><6)
91 [ 1.0, 2.0, 5.0, 6.0 , 9.0, 10.0
91 [ 1.0, 2.0, 5.0, 6.0 , 9.0, 10.0
92 , 3.0, 4.0, 7.0, 8.0 , 11.0 ,12.0 ]
92 , 3.0, 4.0, 7.0, 8.0 , 11.0 ,12.0 ]
93− out = im2col_c 3 2 1 2 input
93+ out = im2col 3 2 1 2 input
94 in expected === out
94 in expected === out
96prop_im2col_bigger = once $
96prop_im2col_bigger = once $
97 let input = (7><7) [ 1.0 .. ]
97 let input = (7><7) [ 1.0 .. ]
98− in im2colUnsafe 5 5 2 2 input === im2col_c 5 5 2 2 input
98+ in im2colUnsafe 5 5 2 2 input === im2col 5 5 2 2 input
100-- If there's no overlap (stride is the same size as the kernel)
100-- If there's no overlap (stride is the same size as the kernel)
101-- then col2im . im2col should be symmetric.
101-- then col2im . im2col should be symmetric.
@@ -104,7 +104,7 @@ prop_im2col_sym_on_same_stride = once $
104 [ 1.0, 2.0, 3.0, 4.0
104 [ 1.0, 2.0, 3.0, 4.0
105 , 5.0, 6.0, 7.0, 8.0
105 , 5.0, 6.0, 7.0, 8.0
106 , 9.0, 10.0, 11.0, 12.0 ]
106 , 9.0, 10.0, 11.0, 12.0 ]
107− out = col2imUnsafe 3 2 3 2 3 4 . im2colUnsafe 3 2 3 2 $ input
107+ out = col2im 3 2 3 2 3 4 . im2colUnsafe 3 2 3 2 $ input
108 in input === out
108 in input === out
110-- If there's no overlap (stride is the same size as the kernel)
110-- If there's no overlap (stride is the same size as the kernel)
@@ -114,7 +114,7 @@ prop_im2colunsafe_sym_on_same_stride = once $
114 [ 1.0, 2.0, 3.0, 4.0
114 [ 1.0, 2.0, 3.0, 4.0
115 , 5.0, 6.0, 7.0, 8.0
115 , 5.0, 6.0, 7.0, 8.0
116 , 9.0, 10.0, 11.0, 12.0 ]
116 , 9.0, 10.0, 11.0, 12.0 ]
117− out = col2imUnsafe 3 2 3 2 3 4 . im2colUnsafe 3 2 3 2 $ input
117+ out = col2im 3 2 3 2 3 4 . im2colUnsafe 3 2 3 2 $ input
118 in input === out
118 in input === out
@@ -129,7 +129,7 @@ prop_im2col_col2im_additive = once $
129 [ 1.0, 2.0, 2.0, 1.0
129 [ 1.0, 2.0, 2.0, 1.0
130 , 2.0, 4.0, 4.0, 2.0
130 , 2.0, 4.0, 4.0, 2.0
131 , 1.0, 2.0, 2.0, 1.0 ]
131 , 1.0, 2.0, 2.0, 1.0 ]
132− out = col2imUnsafe 2 2 1 1 3 4 . im2colUnsafe 2 2 1 1 $ input
132+ out = col2im 2 2 1 1 3 4 . im2colUnsafe 2 2 1 1 $ input
133 in expected === out
133 in expected === out
135prop_simple_conv_forwards = once $
135prop_simple_conv_forwards = once $
@@ -207,7 +207,8 @@ prop_vid2col_no_stride = once $
207 , 6.0, 7.0, 10.0, 11.0 , 26.0, 27.0, 30.0, 31.0
207 , 6.0, 7.0, 10.0, 11.0 , 26.0, 27.0, 30.0, 31.0
208 , 7.0, 8.0, 11.0, 12.0 , 27.0, 28.0, 31.0, 32.0 ]
208 , 7.0, 8.0, 11.0, 12.0 , 27.0, 28.0, 31.0, 32.0 ]
209 out = vid2colUnsafe 2 2 1 1 3 4 input
209 out = vid2colUnsafe 2 2 1 1 3 4 input
210− in expected === out
210+ out_c = vid2col 2 2 1 1 3 4 input
211+ in expected === out .&&. expected === out_c
212prop_vid2col_stride = once $
213prop_vid2col_stride = once $
213 let input = [(3><4)
214 let input = [(3><4)
@@ -223,8 +224,9 @@ prop_vid2col_stride = once $
223 , 3.0, 4.0, 7.0, 8.0 , 23.0, 24.0, 27.0, 28.0
224 , 3.0, 4.0, 7.0, 8.0 , 23.0, 24.0, 27.0, 28.0
224 , 5.0, 6.0, 9.0, 10.0 , 25.0, 26.0, 29.0, 30.0
225 , 5.0, 6.0, 9.0, 10.0 , 25.0, 26.0, 29.0, 30.0
225 , 7.0, 8.0, 11.0, 12.0 , 27.0, 28.0, 31.0, 32.0 ]
226 , 7.0, 8.0, 11.0, 12.0 , 27.0, 28.0, 31.0, 32.0 ]
226− out = vid2colUnsafe 2 2 1 2 3 4 input
227+ out = vid2colUnsafe 2 2 1 2 3 4 input
227− in expected === out
228+ out_c = vid2col 2 2 1 2 3 4 input
229+ in expected === out .&&. expected === out_c
229prop_vid2col_invert = once $
231prop_vid2col_invert = once $
230 let input = [(3><4)
232 let input = [(3><4)
@@ -235,7 +237,7 @@ prop_vid2col_invert = once $
235 [ 21.0, 22.0, 23.0, 24.0
237 [ 21.0, 22.0, 23.0, 24.0
236 , 25.0, 26.0, 27.0, 28.0
238 , 25.0, 26.0, 27.0, 28.0
237 , 29.0, 30.0, 31.0, 32.0 ] ]
239 , 29.0, 30.0, 31.0, 32.0 ] ]
238− out = col2vidUnsafe 3 2 3 2 3 4 . vid2colUnsafe 3 2 3 2 3 4 $ input
240+ out = col2vid 3 2 3 2 3 4 . vid2colUnsafe 3 2 3 2 3 4 $ input
239 in input === out
241 in input === out