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

Feeding same _initial_state_ to all layers #115

Open
vsuarezpaniagua opened this issue Dec 5, 2017 · 0 comments
Open

Feeding same _initial_state_ to all layers #115

vsuarezpaniagua opened this issue Dec 5, 2017 · 0 comments

Comments

@vsuarezpaniagua
Copy link

In the training phase the self.initial_state is used as cell.zero_state and last_state of the last layer is kept:

self.initial_state = cell.zero_state(args.batch_size, tf.float32)
outputs, last_state = legacy_seq2seq.rnn_decoder(inputs, self.initial_state, cell, loop_function=loop if not training else None, scope='rnnlm')
self.final_state = last_state

However, in the testing phase (def sample()) it seems that all the layers are fed just with the state of the last layer of the previous step, self.final_state, as:

feed = {self.input_data: x, self.initial_state: state}
[probs, state] = sess.run([self.probs, self.final_state], feed)

If I'm not wrong I think all the states of each layer must be kept and then fed them in their corresponding layer for the following steps, not feeding the last one to all the layers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant