March 2018
Intermediate to advanced
272 pages
7h 53m
English
In this example, we're actually going to use two separate architectures, one for training and one for inference. We will use the trained layers from training in the inference model. While really we're using the same parts for each architecture, to make things more clear I will show each part separately. The following is the model we will use to train the network:
encoder_input = Input(shape=(None, num_encoder_tokens), name='encoder_input')encoder_outputs, state_h, state_c = LSTM(lstm_units, return_state=True, name="encoder_lstm")(encoder_input)encoder_states = [state_h, state_c]decoder_input = Input(shape=(None, num_decoder_tokens), name='decoder_input')decoder_lstm = LSTM(lstm_units, return_sequences=True, ...