When used dynamic_rnn, a parameter with a name is required initial_state. Easy solution
initial_state = lstm_cell.zero_state(batch_size, tf.float32)
But I want to set the initial state as a parameter that can be optimized, how can I do this?
I can define two learner_variables called h0and c0that are two vectors. But it dynamic_rnnrequires two matrices, where is the first dimension batch_size. How could I expand a vector h0into a matrix, each row of which h0?
source
share