una-dinosauria/human-motion-prediction

A question on Encoder cells and Decoder cells

KavinduZoysa opened this issue · 2 comments

Hi @una-dinosauria,

I have a question on modeling Encoder cells and Decoder cells which still I was unable to solve. Let me explain it like this.

When the seq2seq model is created, first it will create the GRUcell like below.

cell = tf.contrib.rnn.GRUCell( self.rnn_size )

Then it will add the Linear Space decorder to the GRU cell like below.

cell = rnn_cell_extensions.LinearSpaceDecoderWrapper( cell, self.input_size )

After the it will add the redual wrapper to model velocity as below.

cell = rnn_cell_extensions.ResidualWrapper( cell )

Finally that cell is used to model full seq2seq model like below.

outputs, self.states = tf.contrib.legacy_seq2seq.tied_rnn_seq2seq( enc_in, dec_in, cell, loop_function=lf )

According to the below image, the cell which is wrapped by Linear Space decorder wrapper and redual wrapper is only used in decorder and in the encorder we have a simple cell.
screenshot from 2018-10-02 07-09-35

My problem is, according to this implimentation do we expect to run Residual wrapper and Linear space decorder wrapper in side the both encorder and decorder?
Highly appreciated you inputs.

Thank you,
Kavindu

Hi @KavinduZoysa,

In tensorflow, one builds a computational graph and then asks for a node to be evaluated given certain inputs. Because tf knows the graph in advance, it will simply ignore nodes that are not necessary to evaluate the node that one requests (usually the loss function).

I think this is the case for the extra outputs of the encoder -- they do not affect the loss, so they should not be evaluated.

I hope that clarifies things.

Hi @una-dinosauria,

Yes, I understood. Thank you for the answer.

In my MSc programme, I am using this paper to complete one of my projects. I am trying to reproduce the results and I am trying to improve it by changing the architecture/algorithm. That's why I asked you several questions previously to understand the code properly. Thank you again for giving me answers to those questions as well.

Thank you,
Kavindu