(using python)
I have a question about Tensorflow LSTM Implementation. There are currently several implementations in TF, but I use:
cell = tf.contrib.rnn.BasicLSTMCell(n_units)
- where n_units is the number of "parallel" LSTM cells.
Then, to get my output, I call:
rnn_outputs, rnn_states = tf.nn.dynamic_rnn(cell, x, initial_state=initial_state, time_major=False)
- where (as
time_major=False
) x
has the form (batch_size, time_steps, input_length)
- where
batch_size
is my batch_size - where
time_steps
is the number of timestamps with which my RNN will pass - where
input_length
is the length of one of my input vectors (a vector filed into the network at one specific time value in one particular batch)
I expect rnn_outputs to have the form (batch_size, time_steps, n_units, input_length)
, since I did not specify a different output size. The nn.dynamic_rnn
documentation tells me that the output has the form (batch_size, input_length, cell.output_size)
. The tf.contrib.rnn.BasicLSTMCell
documentation has an output_size
property, the default value is n_units (the number of LSTM cells I use).
Thus, each LSTM-Cell only displays a scalar for each given time? I expect it to print the length vector of the input vector. It does not seem to be the way I understand it now, so I'm confused. Can you tell me if this case can, or how I could change it to output an input vector size vector to one lstm cell, maybe?
source share