Skip to content

Commit 318a47d

Browse files
committed
change decoding prediction function
1 parent 5dd98e0 commit 318a47d

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

utils.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,7 @@ def enc_pssm(pssm_file, pad_length=None, pad_left=0):
7272

7373
# Decodes predictions (takes into the account padding of sequence)
7474
def decode(pred, enc_seq):
75-
decoded_pred = []
76-
for pos_pred, pos_seq in zip(pred, enc_seq):
77-
if not np.array_equal(pos_seq, np.zeros(40)):
78-
decoded_pred.append(pos_pred)
79-
return np.asarray(decoded_pred)
75+
return np.delete(pred, np.where(~enc_seq.any(axis=1)), axis=0)[:,1]
8076

8177
# Pipred model architecture
8278
def PiPred_Model():

0 commit comments

Comments
 (0)