Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docs for r1.4 #14474

Merged
merged 3 commits into from
Nov 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 10 additions & 9 deletions tensorflow/docs_src/tutorials/recurrent.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ The core of the model consists of an LSTM cell that processes one word at a
time and computes probabilities of the possible values for the next word in the
sentence. The memory state of the network is initialized with a vector of zeros
and gets updated after reading each word. For computational reasons, we will
process data in mini-batches of size `batch_size`. In this example, it is important
to note that `current_batch_of_words` does not correspond to a "sentence" of words.
Every word in a batch should correspond to time t. Tensorflow will automatically sum
the gradients of each batch for you.
process data in mini-batches of size `batch_size`. In this example, it is
important to note that `current_batch_of_words` does not correspond to a
"sentence" of words. Every word in a batch should correspond to a time t.
TensorFlow will automatically sum the gradients of each batch for you.

For example:
```
Expand All @@ -63,16 +63,17 @@ For example:
[The, red, fox, jumped, high]

words_in_dataset[0] = [The, The]
words_in_dataset[1] = [fox, fox]
words_in_dataset[2] = [is, jumped]
words_in_dataset[3] = [quick, high]
num_batches = 4, batch_size = 2, time_steps = 5
words_in_dataset[1] = [brown, red]
words_in_dataset[2] = [fox, fox]
words_in_dataset[3] = [is, jumped]
words_in_dataset[4] = [quick, high]
batch_size = 2, time_steps = 5
```

The basic pseudocode is as follows:

```python
words_in_dataset = tf.placeholder(tf.float32, [num_batches, batch_size, num_features])
words_in_dataset = tf.placeholder(tf.float32, [time_steps, batch_size, num_features])
lstm = tf.contrib.rnn.BasicLSTMCell(lstm_size)
# Initial state of the LSTM memory.
hidden_state = tf.zeros([batch_size, lstm.state_size])
Expand Down