Skip to content
Snippets Groups Projects
Commit 4bb0738b authored by Tim O'Donnell's avatar Tim O'Donnell
Browse files

Fix encoding for 0-length sequences

parent 873a60a5
No related branches found
No related tags found
No related merge requests found
...@@ -151,11 +151,11 @@ def fixed_vectors_encoding(index_encoded_sequences, letter_to_vector_df): ...@@ -151,11 +151,11 @@ def fixed_vectors_encoding(index_encoded_sequences, letter_to_vector_df):
------- -------
numpy.array of integers with shape (n, k, m) numpy.array of integers with shape (n, k, m)
""" """
(num_sequences, sequence_length) = index_encoded_sequences.shape
target_shape = ( target_shape = (
len(index_encoded_sequences), num_sequences, sequence_length, letter_to_vector_df.shape[0])
len(index_encoded_sequences[0]),
letter_to_vector_df.shape[0])
result = letter_to_vector_df.iloc[ result = letter_to_vector_df.iloc[
index_encoded_sequences.flat index_encoded_sequences.flat
].values.reshape(target_shape) ].values.reshape(target_shape)
return result return result
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment