Skip to content

Commit

Permalink
Keras guides snapshot: Wed, 27 Oct 2021 07:01:55 GMT
Browse files Browse the repository at this point in the history
  • Loading branch information
tfdocsbot committed Oct 27, 2021
1 parent e9aee83 commit ca06383
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions site/en/guide/keras/train_and_evaluate.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@
{
"cell_type": "markdown",
"metadata": {
"id": "26a6d8caca22"
"id": "e2d7d358b4eb"
},
"source": [
"### Custom metrics\n",
Expand All @@ -532,7 +532,7 @@
"- `update_state(self, y_true, y_pred, sample_weight=None)`, which uses the targets\n",
"y_true and the model predictions y_pred to update the state variables.\n",
"- `result(self)`, which uses the state variables to compute the final results.\n",
"- `reset_states(self)`, which reinitializes the state of the metric.\n",
"- `reset_state(self)`, which reinitializes the state of the metric.\n",
"\n",
"State update and results computation are kept separate (in `update_state()` and\n",
"`result()`, respectively) because in some cases, the results computation might be very\n",
Expand All @@ -546,7 +546,7 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "05d6a6e7022d"
"id": "2ad9c57c0683"
},
"outputs": [],
"source": [
Expand All @@ -567,7 +567,7 @@
" def result(self):\n",
" return self.true_positives\n",
"\n",
" def reset_states(self):\n",
" def reset_state(self):\n",
" # The state of the metric will be reset at the start of each epoch.\n",
" self.true_positives.assign(0.0)\n",
"\n",
Expand Down

0 comments on commit ca06383

Please sign in to comment.