March 2018
Intermediate to advanced
272 pages
7h 53m
English
In order to predict an entire sequence given an input sequence, we need to rearrange our architecture just a little. I suspect in future versions of Keras this will be made simpler, but it's a necessary step as of today.
Why does it need to be different? Because we won't have the decoder_input_data teacher vector on inference. We're on our own now. So, we will have to set things up so that we don't require that vector.
Let's take a look at this inference architecture, and then step through the code:
encoder_model = Model(encoder_input, encoder_states)decoder_state_input_h = Input(shape=(lstm_units,))decoder_state_input_c = Input(shape=(lstm_units,))decoder_states_inputs = [decoder_state_input_h, decoder_state_input_c] ...