Unverified Commit de9020d1 authored by Farhad Ramezanghorbani's avatar Farhad Ramezanghorbani Committed by GitHub
Browse files

Avoid loading/padding forces when not needed (#463)

* cleanup

* move forces to additional_properties

* fix typo
parent 4f30aae0
...@@ -49,7 +49,11 @@ dspath = os.path.join(path, '../dataset/ani-1x/sample.h5') ...@@ -49,7 +49,11 @@ dspath = os.path.join(path, '../dataset/ani-1x/sample.h5')
batch_size = 2560 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() training = training.collate(batch_size).cache()
validation = validation.collate(batch_size).cache() validation = validation.collate(batch_size).cache()
......
...@@ -6,13 +6,6 @@ import os ...@@ -6,13 +6,6 @@ import os
path = os.path.dirname(os.path.realpath(__file__)) path = os.path.dirname(os.path.realpath(__file__))
dspath = os.path.join(path, '../dataset/ani-1x/sample.h5') 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): class TestBuiltinModelsJIT(unittest.TestCase):
......
...@@ -67,7 +67,7 @@ if PKBAR_INSTALLED: ...@@ -67,7 +67,7 @@ if PKBAR_INSTALLED:
verbose = True verbose = True
PROPERTIES = ('energies', 'forces') PROPERTIES = ('energies',)
PADDING = { PADDING = {
'species': -1, 'species': -1,
'coordinates': 0.0, 'coordinates': 0.0,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment