Define input_shape for models in intro-teaser.ipynb

This fixes the error:
`Input 0 of layer "dense" is incompatible with the layer: expected
min_ndim=2, found ndim=1. Full shape received: (5,)`, which currently
makes the example codes not run.
This commit is contained in:
bobarna 2021-12-03 12:10:49 +01:00
parent 8d12aac918
commit 6b347889f5

View File

@ -134,7 +134,7 @@
"# Neural network\n",
"act = tf.keras.layers.ReLU()\n",
"nn_sv = tf.keras.models.Sequential([\n",
" tf.keras.layers.Dense(10, activation=act),\n",
" tf.keras.layers.Dense(10, activation=act, input_shape=(1,)),\n",
" tf.keras.layers.Dense(10, activation=act),\n",
" tf.keras.layers.Dense(1,activation='linear')])"
]
@ -264,7 +264,7 @@
"\n",
"# Model\n",
"nn_dp = tf.keras.models.Sequential([\n",
" tf.keras.layers.Dense(10, activation=act),\n",
" tf.keras.layers.Dense(10, activation=act, input_shape=(1,)),\n",
" tf.keras.layers.Dense(10, activation=act),\n",
" tf.keras.layers.Dense(1, activation='linear')])"
]