diff --git a/deepmd_pt/model/model/ener.py b/deepmd_pt/model/model/ener.py index e34a28a6..2d4069bf 100644 --- a/deepmd_pt/model/model/ener.py +++ b/deepmd_pt/model/model/ener.py @@ -59,6 +59,8 @@ def __init__( descriptor['ntypes'] = ntypes self.combination = descriptor.get('combination',False) if(self.combination): + import logging + logging.info("combination right") self.prefactor=descriptor.get('prefactor', [0.5,0.5]) self.descriptor_type = descriptor['type'] diff --git a/deepmd_pt/utils/dataset.py b/deepmd_pt/utils/dataset.py index abc461ab..2b687e95 100644 --- a/deepmd_pt/utils/dataset.py +++ b/deepmd_pt/utils/dataset.py @@ -552,11 +552,14 @@ def single_preprocess(self, batch, sid): return batch else: batch['clean_type'] = clean_type + batch['clean_coord'] = clean_coord + ''' if self.pbc: _clean_coord = normalize_coord(clean_coord, region, nloc) else: _clean_coord = clean_coord.clone() batch['clean_coord'] = _clean_coord + ''' # add noise for i in range(self.max_fail_num): mask_num = 0 @@ -591,13 +594,13 @@ def single_preprocess(self, batch, sid): ) else: NotImplementedError(f"Unknown noise type {self.noise_type}!") - noised_coord = _clean_coord.clone().detach() + noised_coord = clean_coord.clone().detach() noised_coord[coord_mask] += noise_on_coord batch['coord_mask'] = torch.tensor(coord_mask, dtype=torch.bool, device=env.PREPROCESS_DEVICE) else: - noised_coord = _clean_coord + noised_coord = clean_coord batch['coord_mask'] = torch.tensor(np.zeros_like(coord_mask, dtype=np.bool), dtype=torch.bool, device=env.PREPROCESS_DEVICE) @@ -615,7 +618,8 @@ def single_preprocess(self, batch, sid): dtype=torch.bool, device=env.PREPROCESS_DEVICE) if self.pbc: - _coord = region.move_noised_coord_all_in_box(noised_coord, _clean_coord) + _coord = normalize_coord(noised_coord, region, nloc) + #_coord = region.move_noised_coord_all_in_box(noised_coord, _clean_coord) else: _coord = noised_coord.clone() batch['coord'] = _coord @@ -630,6 +634,7 @@ def single_preprocess(self, batch, sid): RuntimeError(f"Add noise times beyond max tries {self.max_fail_num}!") continue batch['atype'] = masked_type + batch['coord'] = noised_coord batch['nlist'] = nlist batch['nlist_loc'] = nlist_loc batch['nlist_type'] = nlist_type