Skip to content

Commit

Permalink
add print sel mean and std
Browse files Browse the repository at this point in the history
  • Loading branch information
iProzd committed Jan 18, 2025
1 parent 5702a47 commit 78eede8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions deepmd/utils/neighbor_stat.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ def get_stat(self, data: DeepmdDataSystem) -> tuple[float, np.ndarray]:
min_nbor_dist = 100.0
max_nbor_size = np.zeros(1 if self.mixed_type else self.ntypes, dtype=int)

sel_list = []

for mn, dt, jj in self.iterator(data):
if np.isinf(dt):
log.warning(
Expand All @@ -78,6 +80,12 @@ def get_stat(self, data: DeepmdDataSystem) -> tuple[float, np.ndarray]:
)
min_nbor_dist = dt
max_nbor_size = np.maximum(mn, max_nbor_size)
sel_list.append(mn)

sel_list = np.array(sel_list).reshape(-1)
print("rcut: ", self.rcut) # noqa T201
print("mean: ", sel_list.mean()) # noqa T201
print("std: ", sel_list.std()) # noqa T201

# do sqrt in the final
min_nbor_dist = math.sqrt(min_nbor_dist)
Expand Down

0 comments on commit 78eede8

Please sign in to comment.