Skip to content

Commit

Permalink
Fix the typo error in custom_train_step_in_tensorflow.ipynb (#1914)
Browse files Browse the repository at this point in the history
* Fix the typo error in custom_train_step_in_tensorflow.ipynb

* fix the typo
  • Loading branch information
tilakrayal authored Aug 21, 2024
1 parent 4c89b46 commit 1922870
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 21 deletions.
4 changes: 2 additions & 2 deletions guides/ipynb/custom_train_step_in_tensorflow.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@
"outputs = keras.layers.Dense(1)(inputs)\n",
"model = CustomModel(inputs, outputs)\n",
"\n",
"# We don't passs a loss or metrics here.\n",
"# We don't pass a loss or metrics here.\n",
"model.compile(optimizer=\"adam\")\n",
"\n",
"# Just use `fit` as usual -- you can use callbacks, etc.\n",
Expand Down Expand Up @@ -642,4 +642,4 @@
},
"nbformat": 4,
"nbformat_minor": 0
}
}
34 changes: 15 additions & 19 deletions guides/ipynb/customizing_what_happens_in_fit.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": null,
"metadata": {
"colab_type": "code"
},
Expand Down Expand Up @@ -107,7 +107,7 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": null,
"metadata": {
"colab_type": "code"
},
Expand Down Expand Up @@ -138,8 +138,7 @@
" else:\n",
" metric.update_state(y, y_pred)\n",
" # Return a dict mapping metric names to current value\n",
" return {m.name: m.result() for m in self.metrics}\n",
""
" return {m.name: m.result() for m in self.metrics}\n"
]
},
{
Expand All @@ -153,7 +152,7 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": null,
"metadata": {
"colab_type": "code"
},
Expand Down Expand Up @@ -200,7 +199,7 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": null,
"metadata": {
"colab_type": "code"
},
Expand Down Expand Up @@ -248,14 +247,13 @@
"outputs = keras.layers.Dense(1)(inputs)\n",
"model = CustomModel(inputs, outputs)\n",
"\n",
"# We don't passs a loss or metrics here.\n",
"# We don't pass a loss or metrics here.\n",
"model.compile(optimizer=\"adam\")\n",
"\n",
"# Just use `fit` as usual -- you can use callbacks, etc.\n",
"x = np.random.random((1000, 32))\n",
"y = np.random.random((1000, 1))\n",
"model.fit(x, y, epochs=5)\n",
""
"model.fit(x, y, epochs=5)\n"
]
},
{
Expand All @@ -278,7 +276,7 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": null,
"metadata": {
"colab_type": "code"
},
Expand Down Expand Up @@ -352,7 +350,7 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": null,
"metadata": {
"colab_type": "code"
},
Expand Down Expand Up @@ -404,13 +402,12 @@
"- A discriminator network meant to classify 28x28x1 images into two classes (\"fake\" and\n",
"\"real\").\n",
"- One optimizer for each.\n",
"- A loss function to train the discriminator.\n",
""
"- A loss function to train the discriminator.\n"
]
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": null,
"metadata": {
"colab_type": "code"
},
Expand Down Expand Up @@ -463,7 +460,7 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": null,
"metadata": {
"colab_type": "code"
},
Expand Down Expand Up @@ -534,8 +531,7 @@
" return {\n",
" \"d_loss\": self.d_loss_tracker.result(),\n",
" \"g_loss\": self.g_loss_tracker.result(),\n",
" }\n",
""
" }\n"
]
},
{
Expand All @@ -549,7 +545,7 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": null,
"metadata": {
"colab_type": "code"
},
Expand Down Expand Up @@ -615,4 +611,4 @@
},
"nbformat": 4,
"nbformat_minor": 0
}
}

0 comments on commit 1922870

Please sign in to comment.