aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow
diff options
context:
space:
mode:
authorGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-08-23 11:57:50 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-08-23 11:57:50 -0700
commit15113cd567f630cd8806deeb82e608357ebed8c3 (patch)
tree13239c08934c5cf0eaf11daf0c67b9ec31ef56a2 /tensorflow
parentd232dee9f9efab16608e0f08ab82c1f51aff78a0 (diff)
parent0c5683c50b2f4afc124ac7c4b61e316b4130b97d (diff)
Merge pull request #21753 from ageron:add_average_loss_and_loss_doc
PiperOrigin-RevId: 209974388
Diffstat (limited to 'tensorflow')
-rw-r--r--tensorflow/docs_src/guide/premade_estimators.md2
-rw-r--r--tensorflow/python/estimator/estimator.py6
2 files changed, 7 insertions, 1 deletions
diff --git a/tensorflow/docs_src/guide/premade_estimators.md b/tensorflow/docs_src/guide/premade_estimators.md
index a1703058c3..9b64d51b98 100644
--- a/tensorflow/docs_src/guide/premade_estimators.md
+++ b/tensorflow/docs_src/guide/premade_estimators.md
@@ -366,6 +366,8 @@ Running this code yields the following output (or something similar):
Test set accuracy: 0.967
```
+The `eval_result` dictionary also contains the `average_loss` (mean loss per sample), the `loss` (mean loss per mini-batch) and the value of the estimator's `global_step` (the number of training iterations it underwent).
+
### Making predictions (inferring) from the trained model
We now have a trained model that produces good evaluation results.
diff --git a/tensorflow/python/estimator/estimator.py b/tensorflow/python/estimator/estimator.py
index f7ee42c7f6..bcbd7b7933 100644
--- a/tensorflow/python/estimator/estimator.py
+++ b/tensorflow/python/estimator/estimator.py
@@ -431,7 +431,11 @@ class Estimator(object):
Returns:
A dict containing the evaluation metrics specified in `model_fn` keyed by
name, as well as an entry `global_step` which contains the value of the
- global step for which this evaluation was performed.
+ global step for which this evaluation was performed. For canned
+ estimators, the dict contains the `loss` (mean loss per mini-batch) and
+ the `average_loss` (mean loss per sample). Canned classifiers also return
+ the `accuracy`. Canned regressors also return the `label/mean` and the
+ `prediction/mean`.
Raises:
ValueError: If `steps <= 0`.