We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f88ab82 commit a100841Copy full SHA for a100841
1 file changed
deepmd/pd/utils/stat.py
@@ -144,7 +144,7 @@ def _post_process_stat(
144
"""Post process the statistics.
145
146
For global statistics, we do not have the std for each type of atoms,
147
- thus fake the output std by ones for all the types.
+ thus broadcast the global std to all the types.
148
If the shape of out_std is already the same as out_bias,
149
we do not need to do anything.
150
@@ -154,7 +154,9 @@ def _post_process_stat(
154
if vv.shape == out_std[kk].shape:
155
new_std[kk] = out_std[kk]
156
else:
157
- new_std[kk] = np.ones_like(vv)
+ ntypes = vv.shape[0]
158
+ reps = [ntypes] + [1] * (vv.ndim - 1)
159
+ new_std[kk] = np.tile(out_std[kk], reps)
160
return out_bias, new_std
161
162
0 commit comments