Created
April 8, 2020 21:48
-
-
Save codingsnap/9d26614348bc35f84ee6ae549c929acb to your computer and use it in GitHub Desktop.
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
# No. of examples | |
n_patterns = len(network_input) | |
print(n_patterns) | |
# Desired shape for LSTM | |
network_input = np.reshape(network_input, (n_patterns, sequence_length, 1)) | |
print(network_input.shape) | |
normalised_network_input = network_input/float(n_vocab) | |
# Network output are the classes, encode into one hot vector | |
network_output = np_utils.to_categorical(network_output) | |
network_output.shape #Output: (60398, 359) | |
print(normalised_network_input.shape) #Output: (60398, 100, 1) | |
print(network_output.shape) #Output: (60398, 359) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment