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:
parent
8d12aac918
commit
6b347889f5
@ -134,7 +134,7 @@
|
|||||||
"# Neural network\n",
|
"# Neural network\n",
|
||||||
"act = tf.keras.layers.ReLU()\n",
|
"act = tf.keras.layers.ReLU()\n",
|
||||||
"nn_sv = tf.keras.models.Sequential([\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(10, activation=act),\n",
|
||||||
" tf.keras.layers.Dense(1,activation='linear')])"
|
" tf.keras.layers.Dense(1,activation='linear')])"
|
||||||
]
|
]
|
||||||
@ -264,7 +264,7 @@
|
|||||||
"\n",
|
"\n",
|
||||||
"# Model\n",
|
"# Model\n",
|
||||||
"nn_dp = tf.keras.models.Sequential([\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(10, activation=act),\n",
|
||||||
" tf.keras.layers.Dense(1, activation='linear')])"
|
" tf.keras.layers.Dense(1, activation='linear')])"
|
||||||
]
|
]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user