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

fix

parent f2858cff
No related branches found
No related tags found
No related merge requests found
......@@ -1032,8 +1032,20 @@ class Class1AffinityPredictor(object):
logging.warning(msg)
if throw:
raise ValueError(msg)
mask = df.supported_peptide_length
if mask.sum() > 0:
mask = df.supported_peptide_length & (
~df.normalized_allele.isin(unsupported_alleles))
if mask is None or mask.all():
# Common case optimization
allele_encoding = AlleleEncoding(
df.normalized_allele,
borrow_from=master_allele_encoding)
for (i, model) in enumerate(self.class1_pan_allele_models):
predictions_array[:, i] = (
model.predict(
peptides,
allele_encoding=allele_encoding,
**model_kwargs))
elif mask.sum() > 0:
masked_allele_encoding = AlleleEncoding(
df.loc[mask].normalized_allele,
borrow_from=master_allele_encoding)
......
......@@ -417,7 +417,7 @@ def train_model(
save_to):
import keras.backend as K
K.clear_session()
K.clear_session() # release memory
df = GLOBAL_DATA["train_data"]
folds_df = GLOBAL_DATA["folds_df"]
......
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