Created using Colaboratory

This commit is contained in:
udlbook
2023-12-07 19:15:25 +00:00
parent 5ba36dd1e8
commit 3258300849

View File

@@ -4,7 +4,7 @@
"metadata": { "metadata": {
"colab": { "colab": {
"provenance": [], "provenance": [],
"authorship_tag": "ABX9TyMmbD0cKYvIHXbKX4AupA1x", "authorship_tag": "ABX9TyNDaU2KKZDyY9Ea7vm/fNxo",
"include_colab_link": true "include_colab_link": true
}, },
"kernelspec": { "kernelspec": {
@@ -114,6 +114,11 @@
" # Create output\n", " # Create output\n",
" out = np.zeros((batchSize, channelsOut, imageHeightOut, imageWidthOut), dtype=np.float32)\n", " out = np.zeros((batchSize, channelsOut, imageHeightOut, imageWidthOut), dtype=np.float32)\n",
"\n", "\n",
" # !!!!!! NOTE THERE IS A SUBTLETY HERE !!!!!!!!\n",
" # I have padded the image with zeros above, so it is surrouned by a \"ring\" of zeros\n",
" # That means that the image indexes are all off by one\n",
" # This actually makes your code simpler\n",
"\n",
" for c_y in range(imageHeightOut):\n", " for c_y in range(imageHeightOut):\n",
" for c_x in range(imageWidthOut):\n", " for c_x in range(imageWidthOut):\n",
" for c_kernel_y in range(kernelHeight):\n", " for c_kernel_y in range(kernelHeight):\n",