We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello, it is very beneficial to read your article. How should I change it if I want to use RNN encoder instead of BiRNN encoder? Thank you!
with tf.name_scope("encoder"): fw_cells = [self.cell(self.num_hidden) for _ in range(self.num_layers)] bw_cells = [self.cell(self.num_hidden) for _ in range(self.num_layers)] fw_cells = [rnn.DropoutWrapper(cell) for cell in fw_cells] bw_cells = [rnn.DropoutWrapper(cell) for cell in bw_cells] encoder_outputs, encoder_state_fw, encoder_state_bw = tf.contrib.rnn.stack_bidirectional_dynamic_rnn( fw_cells, bw_cells, self.encoder_emb_inp, sequence_length=self.X_len, time_major=True, dtype=tf.float32) self.encoder_output = tf.concat(encoder_outputs, 2) encoder_state_c = tf.concat((encoder_state_fw[0].c, encoder_state_bw[0].c), 1) encoder_state_h = tf.concat((encoder_state_fw[0].h, encoder_state_bw[0].h), 1) self.encoder_state = rnn.LSTMStateTuple(c=encoder_state_c, h=encoder_state_h)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello, it is very beneficial to read your article. How should I change it if I want to use RNN encoder instead of BiRNN encoder? Thank you!
The text was updated successfully, but these errors were encountered: