Created
June 29, 2020 20:42
-
-
Save a-agmon/37ae33a212766a5b102266d669e494cb to your computer and use it in GitHub Desktop.
This file contains hidden or 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
def vectorize_sequences(sequences, dimension): | |
results = np.zeros((len(sequences), dimension)) | |
for i, sequence in enumerate(sequences): | |
results[i, sequence] = 1. | |
return results | |
vec_seqs = vectorize_sequences(pad_seqs, VOCAB_SIZE) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment