aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/examples/tutorials
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2017-04-04 16:10:08 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-04-04 17:24:57 -0700
commitccbc8991db3943ef984405881a1c917c530f902f (patch)
treea7b5c760155bfa4ff95ffc0ebd3823c649668997 /tensorflow/examples/tutorials
parent9477900946f923cb43ed76ed215490d01474bfe7 (diff)
Merge changes from github.
Change: 152200430
Diffstat (limited to 'tensorflow/examples/tutorials')
-rw-r--r--tensorflow/examples/tutorials/deepdream/deepdream.ipynb2
-rw-r--r--tensorflow/examples/tutorials/monitors/iris_monitors.py30
2 files changed, 4 insertions, 28 deletions
diff --git a/tensorflow/examples/tutorials/deepdream/deepdream.ipynb b/tensorflow/examples/tutorials/deepdream/deepdream.ipynb
index 016b21cd12..4ff8e368c4 100644
--- a/tensorflow/examples/tutorials/deepdream/deepdream.ipynb
+++ b/tensorflow/examples/tutorials/deepdream/deepdream.ipynb
@@ -278,7 +278,7 @@
" tensor = n.attr['value'].tensor\n",
" size = len(tensor.tensor_content)\n",
" if size > max_const_size:\n",
- " tensor.tensor_content = bytes(\"<stripped %d bytes>\"%size)\n",
+ " tensor.tensor_content = tf.compat.as_bytes(\"<stripped %d bytes>\"%size)\n",
" return strip_def\n",
" \n",
"def rename_nodes(graph_def, rename_func):\n",
diff --git a/tensorflow/examples/tutorials/monitors/iris_monitors.py b/tensorflow/examples/tutorials/monitors/iris_monitors.py
index a4bf353856..850d105f7b 100644
--- a/tensorflow/examples/tutorials/monitors/iris_monitors.py
+++ b/tensorflow/examples/tutorials/monitors/iris_monitors.py
@@ -21,7 +21,6 @@ import os
import numpy as np
import tensorflow as tf
-from tensorflow.contrib.learn.python.learn.metric_spec import MetricSpec
tf.logging.set_verbosity(tf.logging.INFO)
@@ -41,18 +40,15 @@ def main(unused_argv):
"accuracy":
tf.contrib.learn.MetricSpec(
metric_fn=tf.contrib.metrics.streaming_accuracy,
- prediction_key=
- tf.contrib.learn.prediction_key.PredictionKey.CLASSES),
+ prediction_key="classes"),
"precision":
tf.contrib.learn.MetricSpec(
metric_fn=tf.contrib.metrics.streaming_precision,
- prediction_key=
- tf.contrib.learn.prediction_key.PredictionKey.CLASSES),
+ prediction_key="classes"),
"recall":
tf.contrib.learn.MetricSpec(
metric_fn=tf.contrib.metrics.streaming_recall,
- prediction_key=
- tf.contrib.learn.prediction_key.PredictionKey.CLASSES)
+ prediction_key="classes")
}
validation_monitor = tf.contrib.learn.monitors.ValidationMonitor(
test_set.data,
@@ -66,26 +62,6 @@ def main(unused_argv):
# Specify that all features have real-value data
feature_columns = [tf.contrib.layers.real_valued_column("", dimension=4)]
- validation_metrics = {
- "accuracy": MetricSpec(
- metric_fn=tf.contrib.metrics.streaming_accuracy,
- prediction_key="classes"),
- "recall": MetricSpec(
- metric_fn=tf.contrib.metrics.streaming_recall,
- prediction_key="classes"),
- "precision": MetricSpec(
- metric_fn=tf.contrib.metrics.streaming_precision,
- prediction_key="classes")
- }
- validation_monitor = tf.contrib.learn.monitors.ValidationMonitor(
- test_set.data,
- test_set.target,
- every_n_steps=50,
- metrics=validation_metrics,
- early_stopping_metric="loss",
- early_stopping_metric_minimize=True,
- early_stopping_rounds=200)
-
# Build 3 layer DNN with 10, 20, 10 units respectively.
classifier = tf.contrib.learn.DNNClassifier(
feature_columns=feature_columns,