Created
October 11, 2020 16:07
-
-
Save edumunozsala/3aeb88d9c93df1f1bd3f67f810708f33 to your computer and use it in GitHub Desktop.
Padding the input, target and target input sequence for the seq2seq model
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pad the input sequences | |
encoder_inputs = pad_sequences(input_sequences, maxlen=input_max_len, padding='post') | |
print("encoder_inputs.shape:", encoder_inputs.shape) | |
print("encoder_inputs[0]:", encoder_inputs[0]) | |
# pad the decoder input sequences | |
decoder_inputs = pad_sequences(target_sequences_inputs, maxlen=target_max_len, padding='post') | |
print("decoder_inputs[0]:", decoder_inputs[0]) | |
print("decoder_inputs.shape:", decoder_inputs.shape) | |
# pad the target output sequences | |
decoder_targets = pad_sequences(target_sequences, maxlen=target_max_len, padding='post') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment