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
1d75ca19
Commit
1d75ca19
authored
7 years ago
by
Tim O'Donnell
Browse files
Options
Downloads
Patches
Plain Diff
update speed benchmark
parent
7d323a86
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/test_speed.py
+17
-5
17 additions, 5 deletions
test/test_speed.py
with
17 additions
and
5 deletions
test/test_speed.py
+
17
−
5
View file @
1d75ca19
...
...
@@ -3,21 +3,21 @@ numpy.random.seed(0)
import
time
import
cProfile
import
pstats
import
collections
import
pandas
from
mhcflurry
import
Class1AffinityPredictor
from
mhcflurry.encodable_sequences
import
EncodableSequences
from
mhcflurry.common
import
random_peptides
NUM
=
10000
DOWNLOADED_PREDICTOR
=
Class1AffinityPredictor
.
load
()
def
test_speed
(
profile
=
False
):
starts
=
{}
timings
=
{}
profilers
=
{}
starts
=
collections
.
OrderedDict
()
timings
=
collections
.
OrderedDict
()
profilers
=
collections
.
OrderedDict
()
def
start
(
name
):
starts
[
name
]
=
time
.
time
()
...
...
@@ -30,6 +30,8 @@ def test_speed(profile=False):
if
profile
:
profilers
[
name
].
disable
()
NUM
=
10000
start
(
"
first
"
)
DOWNLOADED_PREDICTOR
.
predict
([
"
SIINFEKL
"
],
allele
=
"
HLA-A*02:01
"
)
end
(
"
first
"
)
...
...
@@ -39,6 +41,16 @@ def test_speed(profile=False):
DOWNLOADED_PREDICTOR
.
predict
(
peptides
,
allele
=
"
HLA-A*02:01
"
)
end
(
"
pred_%d
"
%
NUM
)
NUM2
=
10000
peptides
=
EncodableSequences
.
create
(
random_peptides
(
NUM2
,
length
=
13
))
start
(
"
encode_blosum_%d
"
%
NUM2
)
peptides
.
variable_length_to_fixed_length_vector_encoding
(
"
BLOSUM62
"
)
end
(
"
encode_blosum_%d
"
%
NUM2
)
start
(
"
pred_already_encoded_%d
"
%
NUM2
)
DOWNLOADED_PREDICTOR
.
predict
(
peptides
,
allele
=
"
HLA-A*02:01
"
)
end
(
"
pred_already_encoded_%d
"
%
NUM2
)
print
(
"
SPEED BENCHMARK
"
)
print
(
"
Results:
\n
%s
"
%
str
(
pandas
.
Series
(
timings
)))
...
...
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