Merge pull request #449 from gsundeep-tech/chapter_14/conv_example

Chapter 14: Convolution layer example fix
main
Aurélien Geron 2021-07-01 12:33:56 +12:00 committed by GitHub
commit 85c9d790ae
1 changed files with 15 additions and 5 deletions

View File

@ -226,21 +226,31 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"conv = keras.layers.Conv2D(filters=32, kernel_size=3, strides=1,\n",
" padding=\"SAME\", activation=\"relu\")"
" padding=\"SAME\", activation=\"relu\", input_shape=outputs.shape)"
]
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"plot_image(crop(outputs[0, :, :, 0]))\n",
"conv_outputs = conv(outputs)\n",
"conv_outputs.shape "
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"plot_image(conv_outputs[0, :, :, 0])\n",
"plt.show()"
]
},
@ -1368,7 +1378,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.10"
"version": "3.8.10"
},
"nav_menu": {},
"toc": {