|
226 | 226 | "outputs": [],
|
227 | 227 | "source": [
|
228 | 228 | "abalone_model = tf.keras.Sequential([\n",
|
229 |
| - " layers.Dense(64),\n", |
| 229 | + " layers.Dense(64, activation='relu'),\n", |
230 | 230 | " layers.Dense(1)\n",
|
231 | 231 | "])\n",
|
232 | 232 | "\n",
|
|
251 | 251 | },
|
252 | 252 | "outputs": [],
|
253 | 253 | "source": [
|
254 |
| - "abalone_model.fit(abalone_features, abalone_labels, epochs=10)" |
| 254 | + "abalone_model.fit(abalone_features, abalone_labels, epochs=30)" |
255 | 255 | ]
|
256 | 256 | },
|
257 | 257 | {
|
|
337 | 337 | "source": [
|
338 | 338 | "norm_abalone_model = tf.keras.Sequential([\n",
|
339 | 339 | " normalize,\n",
|
340 |
| - " layers.Dense(64),\n", |
| 340 | + " layers.Dense(64, activation='relu'),\n", |
341 | 341 | " layers.Dense(1)\n",
|
342 | 342 | "])\n",
|
343 | 343 | "\n",
|
344 | 344 | "norm_abalone_model.compile(loss = tf.keras.losses.MeanSquaredError(),\n",
|
345 | 345 | " optimizer = tf.keras.optimizers.Adam())\n",
|
346 | 346 | "\n",
|
347 |
| - "norm_abalone_model.fit(abalone_features, abalone_labels, epochs=10)" |
| 347 | + "norm_abalone_model.fit(abalone_features, abalone_labels, epochs=30)" |
348 | 348 | ]
|
349 | 349 | },
|
350 | 350 | {
|
|
646 | 646 | "source": [
|
647 | 647 | "def titanic_model(preprocessing_head, inputs):\n",
|
648 | 648 | " body = tf.keras.Sequential([\n",
|
649 |
| - " layers.Dense(64),\n", |
| 649 | + " layers.Dense(64, activation='relu'),\n", |
650 | 650 | " layers.Dense(1)\n",
|
651 | 651 | " ])\n",
|
652 | 652 | "\n",
|
|
678 | 678 | },
|
679 | 679 | "outputs": [],
|
680 | 680 | "source": [
|
681 |
| - "titanic_model.fit(x=titanic_features_dict, y=titanic_labels, epochs=10)" |
| 681 | + "titanic_model.fit(x=titanic_features_dict, y=titanic_labels, epochs=30)" |
682 | 682 | ]
|
683 | 683 | },
|
684 | 684 | {
|
|
0 commit comments