Skip to content

Commit

Permalink
Add stat_file output
Browse files Browse the repository at this point in the history
  • Loading branch information
anyangml committed Sep 30, 2024
1 parent 9e946fa commit 9b825a8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions deepmd/utils/out_stat.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
)

import numpy as np
import logging

log = logging.getLogger(__name__)


def compute_stats_from_redu(
Expand Down Expand Up @@ -72,6 +75,9 @@ def compute_stats_from_redu(

# computed_output_bias: ntypes, ndim
computed_output_bias, _, _, _ = np.linalg.lstsq(natoms, output_redu, rcond=rcond)
ntypes = natoms.shape[1]
log.info("Computed atom biases: {}".format(list(computed_output_bias.reshape(ntypes))))
log.info("Sampled atom numbers: {}".format(list(natoms.sum(0).reshape(ntypes))))
if assigned_bias is not None:
# add back assigned atom; this might not be required
computed_output_bias[assigned_bias_atom_mask] = assigned_bias_masked
Expand Down

0 comments on commit 9b825a8

Please sign in to comment.