Created
March 6, 2020 06:57
-
-
Save i-amgeek/2a57b7daa6337de541e191a51aa6b955 to your computer and use it in GitHub Desktop.
Convolution Code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for filter in 0..num_filters | |
for channel in 0..input_channels | |
for out_h in 0..output_height | |
for out_w in 0..output_width | |
for k_h in 0..kernel_height | |
for k_w in 0..kernel_width | |
output[filter, out_h, out_w] += | |
kernel[filter, channel, k_h, k_w] * | |
input[channel, out_h + k_h, out_w + k_w] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment