deepmodeling / deepmodeling/deepmd-kit
[mixed_batch=True]: Replace SameNlocBatchSampler with
Open
branch: master
lang: py
todo comment
type: todo
- Dominant language
- Python
- Stars
- 2k
- Forks
- 649
- Avg merge
- 6d 18h
- Merged PRs (30d)
- 15
Description
RandomSampler(replacement=False) + padding collate_fn.
Changes needed:
1. _collate_lmdb_batch: pad coord/force/atype to max_nloc,
add "atom_mask" bool tensor (nframes, max_nloc)
2. Use RandomSampler(_data, replacement=False) as sampler
3. Use fixed batch_size in DataLoader (not batch_sampler)
4. Model forward: apply atom_mask to descriptor/fitting
5. Loss: mask out padded atoms in force loss
Line: 240
https://github.com/deepmodeling/deepmd-kit/blob/565f4beec534576ec27ea32446b0a8e000d989e7/deepmd/pt/train/training.py#L237-L247
Contributor guide
Assessment
This issue has not been assessed yet.