aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/g3doc/tutorials/mnist/beginners/index.md
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/g3doc/tutorials/mnist/beginners/index.md')
-rw-r--r--tensorflow/g3doc/tutorials/mnist/beginners/index.md14
1 files changed, 6 insertions, 8 deletions
diff --git a/tensorflow/g3doc/tutorials/mnist/beginners/index.md b/tensorflow/g3doc/tutorials/mnist/beginners/index.md
index e5d3f28de6..9b6caf8358 100644
--- a/tensorflow/g3doc/tutorials/mnist/beginners/index.md
+++ b/tensorflow/g3doc/tutorials/mnist/beginners/index.md
@@ -376,22 +376,20 @@ to your graph which implement backpropagation and gradient descent. Then it
gives you back a single operation which, when run, does a step of gradient
descent training, slightly tweaking your variables to reduce the loss.
-Now we have our model set up to train. One last thing before we launch it, we
-have to create an operation to initialize the variables we created. Note that
-this defines the operation but does not run it yet:
+
+We can now launch the model in an `InteractiveSession`:
```python
-init = tf.global_variables_initializer()
+sess = tf.InteractiveSession()
```
-We can now launch the model in a `Session`, and now we run the operation that
-initializes the variables:
+We first have to create an operation to initialize the variables we created:
```python
-sess = tf.Session()
-sess.run(init)
+tf.global_variables_initializer().run()
```
+
Let's train -- we'll run the training step 1000 times!
```python