Skip to content

Commit 7312671

Browse files
committed
TensorFlow: Upstream latest changes to git.
Changes: - Documentation updates. - Specify numpy version in required packages. Base CL: 107344010
1 parent a5ac11d commit 7312671

File tree

14 files changed

+110
-110
lines changed

14 files changed

+110
-110
lines changed

tensorflow/g3doc/api_docs/python/ops.md

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

tensorflow/g3doc/api_docs/python/state_ops.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -540,9 +540,9 @@ You number checkpoint filenames by passing a value to the optional
540540
`global_step` argument to `save()`:
541541

542542
```python
543-
saver.save('my-model', global_step=0) ==> filename: 'my-model-0'
543+
saver.save(sess, 'my-model', global_step=0) ==> filename: 'my-model-0'
544544
...
545-
saver.save('my-model', global_step=1000) ==> filename: 'my-model-1000'
545+
saver.save(sess, 'my-model', global_step=1000) ==> filename: 'my-model-1000'
546546
```
547547

548548
Additionally, optional arguments to the `Saver()` constructor let you control
@@ -676,7 +676,7 @@ path can be passed directly to a call to `restore()`.
676676
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
677677

678678

679-
* <b>sess</b>: A Session to use to save the variables..
679+
* <b>sess</b>: A Session to use to save the variables.
680680
* <b>save_path</b>: string. Path to the checkpoint filename. If the saver is
681681
`sharded`, this is the prefix of the sharded checkpoint filename.
682682
* <b>global_step</b>: If provided the global step number is appended to

tensorflow/g3doc/get_started/basic_usage.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,8 @@ with tf.Session() as sess:
286286
```
287287

288288
A `placeholder()` operation generates an error if you do not supply a feed for
289-
it. See the [MNIST fully-connected feed
290-
tutorial](../tutorials/mnist/fully_connected_feed.py) for a larger-scale
291-
example of feeds.
289+
it. See the
290+
[MNIST fully-connected feed tutorial](../tutorials/mnist/tf/index.md)
291+
([source code](https://tensorflow.googlesource.com/tensorflow/+/master/tensorflow/g3doc/tutorials/mnist/fully_connected_feed.py))
292+
for a larger-scale example of feeds.
292293

tensorflow/g3doc/get_started/os_setup.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,21 @@
22

33
## Binary Installation <a class="md-anchor" id="AUTOGENERATED-binary-installation"></a>
44

5+
The TensorFlow Python API requires Python 2.7.
6+
57
### Ubuntu/Linux <a class="md-anchor" id="AUTOGENERATED-ubuntu-linux"></a>
68

9+
**Note**: All the virtualenv-related instructions are optional, but we recommend
10+
using the virtualenv on any multi-user system.
11+
712
Make sure you have [pip](https://pypi.python.org/pypi/pip), the python headers,
813
and (optionally) [virtualenv](https://pypi.python.org/pypi/virtualenv) installed:
914

1015
```bash
1116
$ sudo apt-get install python-pip python-dev python-virtualenv
1217
```
1318

14-
**Note**: All the virtualenv-related instructions are optional, but we recommend
15-
using the virtualenv on any multi-user system.
16-
17-
Set up a new virtualenv environment. Assuming you want to set it up in the
19+
Set up a new virtualenv environment. To set it up in the
1820
directory `~/tensorflow`, run:
1921

2022
```bash
@@ -39,18 +41,19 @@ Inside the virtualenv, install TensorFlow:
3941
# For GPU-enabled version (only install this version if you have the CUDA sdk installed)
4042
(tensorflow)$ pip install --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl
4143

44+
# When you are done using TensorFlow:
4245
(tensorflow)$ deactivate # Deactivate the virtualenv
4346
$ # Your prompt should change back
4447
```
4548

4649
### Mac OS X <a class="md-anchor" id="AUTOGENERATED-mac-os-x"></a>
4750

48-
Make sure you have [pip](https://pypi.python.org/pypi/pip) and
49-
(optionally) [virtualenv](https://pypi.python.org/pypi/virtualenv) installed:
50-
5151
**Note**: All the virtualenv-related instructions are optional, but we recommend
5252
using the virtualenv on any multi-user system.
5353

54+
Make sure you have [pip](https://pypi.python.org/pypi/pip) and
55+
(optionally) [virtualenv](https://pypi.python.org/pypi/virtualenv) installed:
56+
5457
If using `easy_install`:
5558

5659
```bash
@@ -78,6 +81,8 @@ Install TensorFlow (only CPU binary version is currently available).
7881

7982
```bash
8083
(tensorflow)$ pip install --upgrade https://storage.googleapis.com/tensorflow/mac/tensorflow-0.5.0-py2-none-any.whl
84+
85+
# When you are done using TensorFlow:
8186
(tensorflow)$ deactivate # Deactivate the virtualenv
8287
$ # Your prompt should change back
8388
```
@@ -184,7 +189,7 @@ Add the executable `output/bazel` to your `$PATH` environment variable.
184189
$ sudo apt-get install python-numpy swig python-dev
185190
```
186191

187-
#### <a name="install_cuda"></a>Optional: Install CUDA (GPUs on Linux) <a class="md-anchor" id="AUTOGENERATED--a-name--install_cuda----a-optional--install-cuda--gpus-on-linux-"></a>
192+
#### Optional: Install CUDA (GPUs on Linux) <a class="md-anchor" id="install_cuda"></a>
188193

189194
In order to build or run TensorFlow with GPU support, both Cuda Toolkit 7.0 and
190195
CUDNN 6.5 V2 from NVIDIA need to be installed.

tensorflow/g3doc/how_tos/variables/index.md

Lines changed: 43 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
# Variables: Creation, Initialization, Saving, and Loading <a class="md-anchor" id="AUTOGENERATED-variables--creation--initialization--saving--and-loading"></a>
22

3-
When you train a model, you use [Variables](../../api_docs/python/state_ops.md)
3+
When you train a model, you use [variables](../../api_docs/python/state_ops.md)
44
to hold and update parameters. Variables are in-memory buffers containing
5-
tensors. They need to be explicitly initialized and can be saved to disk during
5+
tensors. They must be explicitly initialized and can be saved to disk during
66
and after training. You can later restore saved values to exercise or analyse
77
the model.
88

99
This document references the following TensorFlow classes. Follow the links to
1010
their reference manual for a complete description of their API:
1111

12-
* The `Variable` class [tf.Variable](../../api_docs/python/state_ops.md#Variable).
13-
* The `Saver` class [tf.train.Saver](../../api_docs/python/state_ops.md#Saver).
12+
* The [`tf.Variable`](../../api_docs/python/state_ops.md#Variable) class.
13+
* The [`tf.train.Saver`](../../api_docs/python/state_ops.md#Saver) class.
1414

1515

1616
## Creation <a class="md-anchor" id="AUTOGENERATED-creation"></a>
1717

1818
When you create a [Variable](../../api_docs/python/state_ops.md) you pass a
1919
`Tensor` as its initial value to the `Variable()` constructor. TensorFlow
20-
provides a collection of Ops that produce tensors often used for initialization
20+
provides a collection of ops that produce tensors often used for initialization
2121
from [constants or random values](../../api_docs/python/constant_op.md).
2222

23-
Note that all these Ops require you to specify the shape of the tensors. That
23+
Note that all these ops require you to specify the shape of the tensors. That
2424
shape automatically becomes the shape of the variable. Variables generally
2525
have a fixed shape, but TensorFlow provides advanced mechanisms to reshape
2626
variables.
@@ -32,28 +32,28 @@ weights = tf.Variable(tf.random_normal([784, 200], stddev=0.35),
3232
biases = tf.Variable(tf.zeros([200]), name="biases")
3333
```
3434

35-
Calling `tf.Variable()` adds a few Ops to the graph:
35+
Calling `tf.Variable()` adds several ops to the graph:
3636

37-
* A `variable` Op that holds the variable value.
38-
* An initializer Op that sets the variable to its initial value. This is
39-
actually a `tf.assign` Op.
40-
* The Ops for the initial value, such as the `zeros` Op for the `biases`
37+
* A `variable` op that holds the variable value.
38+
* An initializer op that sets the variable to its initial value. This is
39+
actually a `tf.assign` op.
40+
* The ops for the initial value, such as the `zeros` op for the `biases`
4141
variable in the example are also added to the graph.
4242

4343
The value returned by `tf.Variable()` value is an instance of the Python class
4444
`tf.Variable`.
4545

4646
## Initialization <a class="md-anchor" id="AUTOGENERATED-initialization"></a>
4747

48-
Variable initializers must be run explicitly before other Ops in your model can
49-
be run. The easiest way to do that is to add an Op that runs all the variable
50-
initializers, and run that Op before using the model.
48+
Variable initializers must be run explicitly before other ops in your model can
49+
be run. The easiest way to do that is to add an op that runs all the variable
50+
initializers, and run that op before using the model.
5151

5252
You can alternatively restore variable values from a checkpoint file, see
5353
below.
5454

55-
Use `tf.initialize_all_variables()` to add an Op to run variable initializers.
56-
Only run that Op after you have fully constructed your model and launched it in
55+
Use `tf.initialize_all_variables()` to add an op to run variable initializers.
56+
Only run that op after you have fully constructed your model and launched it in
5757
a session.
5858

5959
```python
@@ -62,13 +62,13 @@ weights = tf.Variable(tf.random_normal([784, 200], stddev=0.35),
6262
name="weights")
6363
biases = tf.Variable(tf.zeros([200]), name="biases")
6464
...
65-
# Add an Op to initialize the variables.
65+
# Add an op to initialize the variables.
6666
init_op = tf.initialize_all_variables()
6767

6868
# Later, when launching the model
6969
with tf.Session() as sess:
7070
# Run the init operation.
71-
sess.Run(init_op)
71+
sess.run(init_op)
7272
...
7373
# Use the model
7474
...
@@ -77,7 +77,7 @@ with tf.Session() as sess:
7777
### Initialization from another Variable <a class="md-anchor" id="AUTOGENERATED-initialization-from-another-variable"></a>
7878

7979
You sometimes need to initialize a variable from the initial value of another
80-
variable. As the Op added by `tf.initialize_all_variables()` initializes all
80+
variable. As the op added by `tf.initialize_all_variables()` initializes all
8181
variables in parallel you have to be careful when this is needed.
8282

8383
To initialize a new variable from the value of another variable use the other
@@ -98,27 +98,29 @@ w_twice = tf.Variable(weights.initialized_value() * 0.2, name="w_twice")
9898

9999
### Custom Initialization <a class="md-anchor" id="AUTOGENERATED-custom-initialization"></a>
100100

101-
The convenience function `tf.initialize_all_variables()` adds an Op to
101+
The convenience function `tf.initialize_all_variables()` adds an op to
102102
initialize *all variables* in the model. You can also pass it an explicit list
103103
of variables to initialize. See the
104104
[Variables Documentation](../../api_docs/python/state_ops.md) for more options,
105105
including checking if variables are initialized.
106106

107107
## Saving and Restoring <a class="md-anchor" id="AUTOGENERATED-saving-and-restoring"></a>
108108

109-
The easiest way to save and restore a model is to use a `tf.train.Saver`
110-
object. The constructor adds `save` and `restore` Ops to the graph for all, or
111-
a specified list, of variables. The saver object provides methods to run these
112-
Ops, specifying paths for the checkpoint files to write to or read from.
109+
The easiest way to save and restore a model is to use a `tf.train.Saver` object.
110+
The constructor adds `save` and `restore` ops to the graph for all, or a
111+
specified list, of the variables in the graph. The saver object provides
112+
methods to run these ops, specifying paths for the checkpoint files to write to
113+
or read from.
113114

114115
### Checkpoint Files <a class="md-anchor" id="AUTOGENERATED-checkpoint-files"></a>
115116

116-
Variables are saved in binary files that, roughly, contains a map from variable
117-
names to tensors.
117+
Variables are saved in binary files that, roughly, contain a map from variable
118+
names to tensor values.
118119

119-
When you create a `Saver` object, you can optionally chose names for the
120-
variables in the checkpoint files. By default, it uses the names passed to the
121-
`tf.Variable()` call.
120+
When you create a `Saver` object, you can optionally choose names for the
121+
variables in the checkpoint files. By default, it uses the value of the
122+
[`Variable.name`](../../api_docs/python/state_ops.md#Variable.name) property for
123+
each variable.
122124

123125
### Saving Variables <a class="md-anchor" id="AUTOGENERATED-saving-variables"></a>
124126

@@ -130,20 +132,20 @@ the model.
130132
v1 = tf.Variable(..., name="v1")
131133
v2 = tf.Variable(..., name="v2")
132134
...
133-
# Add an Op to initialize the variables.
135+
# Add an op to initialize the variables.
134136
init_op = tf.initialize_all_variables()
135137

136-
# Add Ops to save and restore all the variables.
138+
# Add ops to save and restore all the variables.
137139
saver = tf.train.Saver()
138140

139141
# Later, launch the model, initialize the variables, do some work, save the
140142
# variables to disk.
141143
with tf.Session() as sess:
142-
sess.Run(init_op)
144+
sess.run(init_op)
143145
# Do some work with the model.
144146
..
145147
# Save the variables to disk.
146-
save_path = saver.Save(sess, "/tmp/model.ckpt")
148+
save_path = saver.save(sess, "/tmp/model.ckpt")
147149
print "Model saved in file: ", save_path
148150
```
149151

@@ -157,23 +159,23 @@ restore variables from a file you do not have to initialize them beforehand.
157159
v1 = tf.Variable(..., name="v1")
158160
v2 = tf.Variable(..., name="v2")
159161
...
160-
# Add Ops to save and restore all the variables.
162+
# Add ops to save and restore all the variables.
161163
saver = tf.train.Saver()
162164

163165
# Later, launch the model, use the saver to restore variables from disk, and
164166
# do some work with the model.
165167
with tf.Session() as sess:
166168
# Restore variables from disk.
167-
saver.Restore(sess, "/tmp/model.ckpt")
169+
saver.restore(sess, "/tmp/model.ckpt")
168170
print "Model restored."
169171
# Do some work with the model
170172
...
171173
```
172174

173-
### Chosing which Variables to Save and Restore <a class="md-anchor" id="AUTOGENERATED-chosing-which-variables-to-save-and-restore"></a>
175+
### Choosing which Variables to Save and Restore <a class="md-anchor" id="AUTOGENERATED-choosing-which-variables-to-save-and-restore"></a>
174176

175-
If you do not pass any argument to `tf.train.Saver()` the saver
176-
handles all variables. Each one of them is saved under the name that was
177+
If you do not pass any argument to `tf.train.Saver()` the saver handles all
178+
variables in the graph. Each one of them is saved under the name that was
177179
passed when the variable was created.
178180

179181
It is sometimes useful to explicitly specify names for variables in the
@@ -196,10 +198,10 @@ Notes:
196198
* You can create as many saver objects as you want if you need to save and
197199
restore different subsets of the model variables. The same variable can be
198200
listed in multiple saver objects, its value is only changed when the saver
199-
`Restore()` method is run.
201+
`restore()` method is run.
200202

201203
* If you only restore a subset of the model variables at the start
202-
of a session, you have to run an initialize Op for the other variables. See
204+
of a session, you have to run an initialize op for the other variables. See
203205
[`tf.initialize_variables()`](../../api_docs/python/state_ops.md#initialize_variables)
204206
for more information.
205207

@@ -208,7 +210,7 @@ Notes:
208210
v1 = tf.Variable(..., name="v1")
209211
v2 = tf.Variable(..., name="v2")
210212
...
211-
# Add Ops to save and restore only 'v2' using the name "my_v2"
213+
# Add ops to save and restore only 'v2' using the name "my_v2"
212214
saver = tf.train.Saver({"my_v2": v2})
213215
# Use the saver object normally after that.
214216
...

tensorflow/g3doc/tutorials/mandelbrot/index.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ general mathematics. This is actually a pretty naive implementation of the
66
visualization, but it makes the point. (We may end up providing a more
77
elaborate implementation down the line to produce more truly beautiful images.)
88

9-
Note: This tutorial was originally prepared as an iPython notebook.
9+
Note: This tutorial was originally prepared as an IPython notebook.
1010

1111
## Basic Setup <a class="md-anchor" id="AUTOGENERATED-basic-setup"></a>
1212

1313
We'll need a few imports to get started.
1414

1515
```python
16-
#Import libraries for simulation
16+
# Import libraries for simulation
1717
import tensorflow as tf
1818
import numpy as np
1919

20-
#Imports for visualization
20+
# Imports for visualization
2121
import PIL.Image
2222
from cStringIO import StringIO
2323
from IPython.display import clear_output, Image, display
@@ -45,7 +45,7 @@ def DisplayFractal(a, fmt='jpeg'):
4545

4646
## Session and Variable Initialization <a class="md-anchor" id="AUTOGENERATED-session-and-variable-initialization"></a>
4747

48-
For playing around like this, we often us an interactive session, but a regular
48+
For playing around like this, we often use an interactive session, but a regular
4949
session would work as well.
5050

5151
```python
@@ -61,7 +61,7 @@ Y, X = np.mgrid[-1.3:1.3:0.005, -2:1:0.005]
6161
Z = X+1j*Y
6262
```
6363

64-
Now we define and initialize.
64+
Now we define and initialize TensorFlow tensors.
6565

6666
```python
6767
xs = tf.constant(Z.astype("complex64"))
@@ -72,7 +72,7 @@ ns = tf.Variable(tf.zeros_like(xs, "float32"))
7272
TensorFlow requires that you explicitly initialize variables before using them.
7373

7474
```python
75-
tf.InitializeAllVariables().run()
75+
tf.initialize_all_variables().run()
7676
```
7777

7878
## Defining and Running the Computation <a class="md-anchor" id="AUTOGENERATED-defining-and-running-the-computation"></a>

tensorflow/g3doc/tutorials/mnist/beginners/index.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,11 @@ work through the code.
3434
## The MNIST Data <a class="md-anchor" id="AUTOGENERATED-the-mnist-data"></a>
3535

3636
The MNIST data is hosted on
37-
[Yann LeCun's website](http://yann.lecun.com/exdb/mnist/).
38-
For your convenience, we've included some python code to download and install
39-
the data automatically. You can either download [the code](../input_data.py) and
40-
import it as below, or simply copy and paste it in.
37+
[Yann LeCun's website](http://yann.lecun.com/exdb/mnist/). For your
38+
convenience, we've included some python code to download and install the data
39+
automatically. You can either download
40+
[the code](https://tensorflow.googlesource.com/tensorflow/+/master/tensorflow/g3doc/tutorials/mnist/input_data.py)
41+
and import it as below, or simply copy and paste it in.
4142

4243
```python
4344
import input_data

0 commit comments

Comments
 (0)