Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mhc_rank
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Patrick Skillman-Lawrence
mhc_rank
Commits
5e96719f
Commit
5e96719f
authored
7 years ago
by
Tim O'Donnell
Browse files
Options
Downloads
Patches
Plain Diff
attempt fix race condition
parent
1cae85f6
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
mhcflurry/class1_neural_network.py
+7
-0
7 additions, 0 deletions
mhcflurry/class1_neural_network.py
mhcflurry/train_allele_specific_models_command.py
+4
-1
4 additions, 1 deletion
mhcflurry/train_allele_specific_models_command.py
with
11 additions
and
1 deletion
mhcflurry/class1_neural_network.py
+
7
−
0
View file @
5e96719f
...
...
@@ -125,6 +125,13 @@ class Class1NeuralNetwork(object):
(Keras model, existing network weights)
"""
@classmethod
def
clear_model_cache
(
klass
):
"""
Clear the Keras model cache.
"""
klass
.
KERAS_MODELS_CACHE
.
clear
()
@classmethod
def
borrow_cached_network
(
klass
,
network_json
,
network_weights
):
"""
...
...
This diff is collapsed.
Click to expand it.
mhcflurry/train_allele_specific_models_command.py
+
4
−
1
View file @
5e96719f
...
...
@@ -17,6 +17,7 @@ from mhcnames import normalize_allele_name
import
tqdm
# progress bar
from
.class1_affinity_predictor
import
Class1AffinityPredictor
from
.class1_neural_network
import
Class1NeuralNetwork
from
.common
import
configure_logging
,
set_keras_backend
...
...
@@ -281,10 +282,11 @@ def run(argv=sys.argv[1:]):
# Store peptides in global variable so they are in shared memory
# after fork, instead of needing to be pickled.
GLOBAL_DATA
[
"
calibration_peptides
"
]
=
encoded_peptides
Class1NeuralNetwork
.
clear_model_cache
()
worker_pool
=
Pool
(
processes
=
(
args
.
calibration_num_jobs
if
args
.
trai
n_num_jobs
else
None
))
if
args
.
calibratio
n_num_jobs
else
None
))
print
(
"
Using worker pool: %s
"
%
str
(
worker_pool
))
results
=
worker_pool
.
imap_unordered
(
partial
(
...
...
@@ -376,6 +378,7 @@ def calibrate_percentile_ranks(allele, predictor, peptides=None):
"""
Private helper function.
"""
global
GLOBAL_DATA
if
peptides
is
None
:
peptides
=
GLOBAL_DATA
[
"
calibration_peptides
"
]
predictor
.
calibrate_percentile_ranks
(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment