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

cache peptide encoding in percentile rank calibration

parent 172907c9
No related branches found
No related tags found
No related merge requests found
...@@ -933,7 +933,7 @@ class Class1AffinityPredictor(object): ...@@ -933,7 +933,7 @@ class Class1AffinityPredictor(object):
encoded_peptides = EncodableSequences.create(peptides) encoded_peptides = EncodableSequences.create(peptides)
for (i, allele) in enumerate(alleles): for (i, allele) in enumerate(alleles):
predictions = self.predict(peptides, allele=allele) predictions = self.predict(encoded_peptides, allele=allele)
transform = PercentRankTransform() transform = PercentRankTransform()
transform.fit(predictions, bins=bins) transform.fit(predictions, bins=bins)
self.allele_to_percent_rank_transform[allele] = transform self.allele_to_percent_rank_transform[allele] = transform
......
...@@ -9,6 +9,7 @@ import time ...@@ -9,6 +9,7 @@ import time
import traceback import traceback
from multiprocessing import Pool from multiprocessing import Pool
from functools import partial from functools import partial
from pprint import pprint
import pandas import pandas
import yaml import yaml
...@@ -363,7 +364,7 @@ def train_model( ...@@ -363,7 +364,7 @@ def train_model(
# For the first model for the first allele, print the architecture. # For the first model for the first allele, print the architecture.
print("*** HYPERPARAMETER SET %d***" % print("*** HYPERPARAMETER SET %d***" %
(hyperparameter_set_num + 1)) (hyperparameter_set_num + 1))
print(hyperparameters) pprint(hyperparameters)
print("*** ARCHITECTURE FOR HYPERPARAMETER SET %d***" % print("*** ARCHITECTURE FOR HYPERPARAMETER SET %d***" %
(hyperparameter_set_num + 1)) (hyperparameter_set_num + 1))
model.network(borrow=True).summary() model.network(borrow=True).summary()
......
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