Skip to content

Commit

Permalink
Merge pull request #60 from DandilionLau/master
Browse files Browse the repository at this point in the history
Init using np.zeros instead of np.empty to avoid overflow
  • Loading branch information
eriklindernoren authored Oct 18, 2019
2 parents 40b52e4 + 19b7c25 commit a2806c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mlfromscratch/deep_learning/layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a2806c6

Please sign in to comment.