From 19b7c251dac7b6e952a00467c2cecc9cce67d623 Mon Sep 17 00:00:00 2001 From: DandilionLau Date: Sun, 6 Oct 2019 15:57:23 -0400 Subject: [PATCH] init as zeros, avoid overflow --- mlfromscratch/deep_learning/layers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mlfromscratch/deep_learning/layers.py b/mlfromscratch/deep_learning/layers.py index 1f931fe9..97c30c3a 100644 --- a/mlfromscratch/deep_learning/layers.py +++ b/mlfromscratch/deep_learning/layers.py @@ -718,7 +718,7 @@ def column_to_image(cols, images_shape, filter_shape, stride, output_shape='same pad_h, pad_w = determine_padding(filter_shape, output_shape) height_padded = height + np.sum(pad_h) width_padded = width + np.sum(pad_w) - images_padded = np.empty((batch_size, channels, height_padded, width_padded)) + images_padded = np.zeros((batch_size, channels, height_padded, width_padded)) # Calculate the indices where the dot products are applied between weights # and the image