Skip to content

Instantly share code, notes, and snippets.

@shubham0204
Created March 23, 2019 12:35
Show Gist options
  • Save shubham0204/52866fcc2e5416e7e8d72ad60628cc51 to your computer and use it in GitHub Desktop.
Save shubham0204/52866fcc2e5416e7e8d72ad60628cc51 to your computer and use it in GitHub Desktop.
def make_inference_models():
encoder_model = tf.keras.models.Model(encoder_inputs, encoder_states)
decoder_state_input_h = tf.keras.layers.Input(shape=( 200 ,))
decoder_state_input_c = tf.keras.layers.Input(shape=( 200 ,))
decoder_states_inputs = [decoder_state_input_h, decoder_state_input_c]
decoder_outputs, state_h, state_c = decoder_lstm(
decoder_embedding , initial_state=decoder_states_inputs)
decoder_states = [state_h, state_c]
decoder_outputs = decoder_dense(decoder_outputs)
decoder_model = tf.keras.models.Model(
[decoder_inputs] + decoder_states_inputs,
[decoder_outputs] + decoder_states)
return encoder_model , decoder_model
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment