Skip to content

Commit f01524d

Browse files
committed
Merge commit for internal changes
2 parents e7242aa + b260fe4 commit f01524d

File tree

7 files changed

+42
-303
lines changed

7 files changed

+42
-303
lines changed

api_guides/python/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@
55
* [Constants, Sequences, and Random Values](constant_op.md)
66
* [Control Flow](control_flow_ops.md)
77
* [Data IO (Python functions)](python_io.md)
8+
* [Exporting and Importing a MetaGraph](meta_graph.md)
89
* [Higher Order Functions](functional_ops.md)
910
* [Histograms](histogram_ops.md)
1011
* [Images](image.md)
1112
* [Inputs and Readers](io_ops.md)
1213
* [Math](math_ops.md)
1314
* [Neural Network](nn.md)
15+
* [Reading data](reading_data.md)
1416
* [Running Graphs](client.md)
1517
* [Sparse Tensors](sparse_ops.md)
1618
* [Spectral Functions](spectral_ops.md)

programmers_guide/reading_data.md renamed to api_guides/python/reading_data.md

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Reading data
22

3-
There are three main methods of getting data into a TensorFlow program:
3+
Note: The preferred way to feed data into a tensorflow program is using the
4+
@{$datasets$Datasets API}.
5+
6+
There are three other methods of getting data into a TensorFlow program:
47

58
* Feeding: Python code provides the data when running each step.
69
* Reading from files: an input pipeline reads the data from files
@@ -19,6 +22,9 @@ graph.
1922
Supply feed data through the `feed_dict` argument to a run() or eval() call
2023
that initiates computation.
2124

25+
Note: "Feeding" is the least efficient way to feed data into a tensorflow
26+
program and should only be used for small experiments and debugging.
27+
2228
```python
2329
with tf.Session():
2430
input = tf.placeholder(tf.float32)
@@ -51,6 +57,9 @@ A typical pipeline for reading records from files has the following stages:
5157
7. *Optional* preprocessing
5258
8. Example queue
5359

60+
Note: This section discusses implementing input pipelines useing the
61+
queue-based APIs which can be cleanly replaced by the ${$datasets$Dataset API}.
62+
5463
### Filenames, shuffling, and epoch limits
5564

5665
For the list of filenames, use either a constant string Tensor (like
@@ -405,7 +414,8 @@ This is only used for small data sets that can be loaded entirely in memory.
405414
There are two approaches:
406415

407416
* Store the data in a constant.
408-
* Store the data in a variable, that you initialize and then never change.
417+
* Store the data in a variable, that you initialize (or assign to) and then
418+
never change.
409419

410420
Using a constant is a bit simpler, but uses more memory (since the constant is
411421
stored inline in the graph data structure, which may be duplicated a few times).
@@ -461,19 +471,31 @@ You can compare these with the `fully_connected_feed` and
461471
## Multiple input pipelines
462472

463473
Commonly you will want to train on one dataset and evaluate (or "eval") on
464-
another. One way to do this is to actually have two separate processes:
474+
another. One way to do this is to actually have two separate graphs and
475+
sessions, maybe in separate processes:
465476

466477
* The training process reads training input data and periodically writes
467478
checkpoint files with all the trained variables.
468479
* The evaluation process restores the checkpoint files into an inference
469480
model that reads validation input data.
470481

471-
This is what is done in
472-
@{$deep_cnn#save-and-restore-checkpoints$the example CIFAR-10 model}. This has a couple of benefits:
482+
This is what is done @{tf.estimator$estimators} and manually in
483+
@{$deep_cnn#save-and-restore-checkpoints$the example CIFAR-10 model}.
484+
This has a couple of benefits:
473485

474486
* The eval is performed on a single snapshot of the trained variables.
475487
* You can perform the eval even after training has completed and exited.
476488

477489
You can have the train and eval in the same graph in the same process, and share
478-
their trained variables. See
479-
@{$variables$the shared variables tutorial}.
490+
their trained variables or layers. See @{$variables$the shared variables tutorial}.
491+
492+
To support the single-graph approach
493+
@{$programmers_guide/datasets$Datasets} also supplies
494+
@{$programmers_guide/datasets#creating_an_iterator$advanced iterator types} that
495+
that allow the user to change the input pipeline without rebuilding the graph or
496+
session.
497+
498+
Note: Regardless of the implementation, many
499+
operations (like ${tf.layers.batch_normalization}, and @{tf.layers.dropout})
500+
need to know if they are in training or evaluation mode, and you must be
501+
careful to set this apropriately if you change the data source.

get_started/embedding_viz.md

Lines changed: 0 additions & 287 deletions
This file was deleted.

get_started/index.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ To learn about the high-level API, read the following guides:
2222

2323
* @{$get_started/estimator$tf.estimator Quickstart}, which introduces this
2424
API.
25-
* @{$get_started/input_fn$Building Input Functions with tf.contrib.learn},
25+
* @{$get_started/input_fn$Building Input Functions},
2626
which takes you into a somewhat more sophisticated use of this API.
2727
* @{$get_started/monitors$Logging and Monitoring Basics with tf.contrib.learn},
2828
which explains how to audit the progress of model training.
@@ -32,9 +32,6 @@ The following guides explain how to use TensorBoard:
3232

3333
* @{$get_started/summaries_and_tensorboard$TensorBoard: Visualizing Learning},
3434
which gets you started.
35-
* @{$get_started/embedding_viz$TensorBoard: Embedding Visualization}, which
36-
demonstrates how to view and interact with high-dimensional data, such as
37-
embeddings.
3835
* @{$get_started/graph_viz$TensorBoard: Graph Visualization}, which explains
3936
how to visualize the computational graph. Graph visualization is typically
4037
more useful for programmers using the low-level API.

0 commit comments

Comments
 (0)