2
$\begingroup$

I've implemented a seq2seq model for character-based text mirroring as a part of Udacity's Deep Learning class (here's the code).

My model is very basic because it's a single LSTM as both encoder and decoder. You can see that it performs rather poorly (it only managed to learn how to mirror the first few characters of text). But I can't extend it to two LSTM's because it's confusing to me how backprop should work with such architecure. We don't have labels to get the errors for encoder states. Is it necessary to somehow compute gradients manually at the encoder's output and back-propagate it further, or Tensorflow's graph will handle it automatically?

$\endgroup$

1 Answer 1

3
$\begingroup$

Well here we don't take the errors in encoder time steps. What we do is we transform all the time step information in to a vector representation where it can help to generate correct labels in encoder side.

The gradient method is simple. It's same as how we take gradients in standard RNN. But here we start to propagate gradients from decoder side only. The method is called the back propagation through time. You can understand that clearly in Chis Olah's amazing blog. Also read about the this amazing article on seq2seq model by google

$\endgroup$
1
  • $\begingroup$ Thank you very much. So in LSTM encoder-decoder, only the decoder part got backpropagated! I have always been confused. $\endgroup$
    – Avv
    Commented Feb 25, 2023 at 3:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.