In this question How do I set TensorFlow RNN state when state_is_tuple=True?: the accepted answer initialize the initial state like this:
state_placeholder = tf.placeholder(tf.float32, [num_layers, 2, batch_size, state_size])
I assume this requires a specific batch size, while what I have now is:
inputSeq = tf.placeholder(tf.float32, [None, seqLength, observationDim], name='input_seq')
outputs, final_state = tf.nn.dynamic_rnn(cell, inputSeq, initial_state=initialState)
And I want this initialState
to be a zero state, and can be configurable as the batch size of inputSeq
could vary. However, cell.zero_state
does not accept None as batch size. Is there any workaround?