Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
torchani
Commits
6e50a99e
Unverified
Commit
6e50a99e
authored
Apr 07, 2019
by
Gao, Xiang
Committed by
GitHub
Apr 07, 2019
Browse files
benchmark each function (#201)
parent
6f2a3d5f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
tools/training-benchmark.py
tools/training-benchmark.py
+13
-0
No files found.
tools/training-benchmark.py
View file @
6e50a99e
...
@@ -92,6 +92,16 @@ def time_func(key, func):
...
@@ -92,6 +92,16 @@ def time_func(key, func):
# enable timers
# enable timers
torchani
.
aev
.
cutoff_cosine
=
time_func
(
'torchani.aev.cutoff_cosine'
,
torchani
.
aev
.
cutoff_cosine
)
torchani
.
aev
.
radial_terms
=
time_func
(
'torchani.aev.radial_terms'
,
torchani
.
aev
.
radial_terms
)
torchani
.
aev
.
angular_terms
=
time_func
(
'torchani.aev.angular_terms'
,
torchani
.
aev
.
angular_terms
)
torchani
.
aev
.
compute_shifts
=
time_func
(
'torchani.aev.compute_shifts'
,
torchani
.
aev
.
compute_shifts
)
torchani
.
aev
.
neighbor_pairs
=
time_func
(
'torchani.aev.neighbor_pairs'
,
torchani
.
aev
.
neighbor_pairs
)
torchani
.
aev
.
triu_index
=
time_func
(
'torchani.aev.triu_index'
,
torchani
.
aev
.
triu_index
)
torchani
.
aev
.
convert_pair_index
=
time_func
(
'torchani.aev.convert_pair_index'
,
torchani
.
aev
.
convert_pair_index
)
torchani
.
aev
.
cumsum_from_zero
=
time_func
(
'torchani.aev.cumsum_from_zero'
,
torchani
.
aev
.
cumsum_from_zero
)
torchani
.
aev
.
triple_by_molecule
=
time_func
(
'torchani.aev.triple_by_molecule'
,
torchani
.
aev
.
triple_by_molecule
)
torchani
.
aev
.
compute_aev
=
time_func
(
'torchani.aev.compute_aev'
,
torchani
.
aev
.
compute_aev
)
nnp
[
0
].
forward
=
time_func
(
'total'
,
nnp
[
0
].
forward
)
nnp
[
0
].
forward
=
time_func
(
'total'
,
nnp
[
0
].
forward
)
nnp
[
1
].
forward
=
time_func
(
'forward'
,
nnp
[
1
].
forward
)
nnp
[
1
].
forward
=
time_func
(
'forward'
,
nnp
[
1
].
forward
)
...
@@ -99,6 +109,9 @@ nnp[1].forward = time_func('forward', nnp[1].forward)
...
@@ -99,6 +109,9 @@ nnp[1].forward = time_func('forward', nnp[1].forward)
start
=
timeit
.
default_timer
()
start
=
timeit
.
default_timer
()
trainer
.
run
(
dataset
,
max_epochs
=
1
)
trainer
.
run
(
dataset
,
max_epochs
=
1
)
elapsed
=
round
(
timeit
.
default_timer
()
-
start
,
2
)
elapsed
=
round
(
timeit
.
default_timer
()
-
start
,
2
)
for
k
in
timers
:
if
k
.
startswith
(
'torchani.'
):
print
(
k
,
timers
[
k
])
print
(
'Total AEV:'
,
timers
[
'total'
])
print
(
'Total AEV:'
,
timers
[
'total'
])
print
(
'NN:'
,
timers
[
'forward'
])
print
(
'NN:'
,
timers
[
'forward'
])
print
(
'Epoch time:'
,
elapsed
)
print
(
'Epoch time:'
,
elapsed
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment