Skip to content

Commit

Permalink
Add pre_transform and pre_filter
Browse files Browse the repository at this point in the history
  • Loading branch information
RaulPPelaez committed Jun 28, 2024
1 parent 23b9bea commit 33cd988
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions torchmdnet/datasets/maceoff.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ def sample_iter(self, mol_ids=False):
if self.max_gradient:
if data.neg_dy.norm(dim=1).max() > float(self.max_gradient):
continue
if self.pre_filter is not None and not self.pre_filter(data):
continue
if self.pre_transform is not None:
data = self.pre_transform(data)
yield data

def download(self):
Expand Down

0 comments on commit 33cd988

Please sign in to comment.