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
de9020d1
Unverified
Commit
de9020d1
authored
May 01, 2020
by
Farhad Ramezanghorbani
Committed by
GitHub
May 01, 2020
Browse files
Avoid loading/padding forces when not needed (#463)
* cleanup * move forces to additional_properties * fix typo
parent
4f30aae0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
9 deletions
+6
-9
examples/nnp_training_force.py
examples/nnp_training_force.py
+5
-1
tests/test_jit_builtin_models.py
tests/test_jit_builtin_models.py
+0
-7
torchani/data/__init__.py
torchani/data/__init__.py
+1
-1
No files found.
examples/nnp_training_force.py
View file @
de9020d1
...
...
@@ -49,7 +49,11 @@ dspath = os.path.join(path, '../dataset/ani-1x/sample.h5')
batch_size
=
2560
training
,
validation
=
torchani
.
data
.
load
(
dspath
).
subtract_self_energies
(
energy_shifter
).
species_to_indices
(
species_order
).
shuffle
().
split
(
0.8
,
None
)
training
,
validation
=
torchani
.
data
.
load
(
dspath
,
additional_properties
=
(
'forces'
,)
).
subtract_self_energies
(
energy_shifter
).
species_to_indices
(
species_order
).
shuffle
().
split
(
0.8
,
None
)
training
=
training
.
collate
(
batch_size
).
cache
()
validation
=
validation
.
collate
(
batch_size
).
cache
()
...
...
tests/test_jit_builtin_models.py
View file @
de9020d1
...
...
@@ -6,13 +6,6 @@ import os
path
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
dspath
=
os
.
path
.
join
(
path
,
'../dataset/ani-1x/sample.h5'
)
batch_size
=
256
chunk_threshold
=
5
other_properties
=
{
'properties'
:
[
'energies'
],
'padding_values'
:
[
None
],
'padded_shapes'
:
[(
batch_size
,
)],
'dtypes'
:
[
torch
.
float64
],
}
class
TestBuiltinModelsJIT
(
unittest
.
TestCase
):
...
...
torchani/data/__init__.py
View file @
de9020d1
...
...
@@ -67,7 +67,7 @@ if PKBAR_INSTALLED:
verbose
=
True
PROPERTIES
=
(
'energies'
,
'forces'
)
PROPERTIES
=
(
'energies'
,)
PADDING
=
{
'species'
:
-
1
,
'coordinates'
:
0.0
,
...
...
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