deepmd.dpmodel.utils.env_mat_stat#
Classes#
A base class to store and calculate the statistics of the environment matrix. | |
Environmental matrix statistics for the se_a/se_r environmental matrix. |
Functions#
| Merge descriptor env mat stats from link_obj into base_obj. |
Module Contents#
- deepmd.dpmodel.utils.env_mat_stat.merge_env_stat(base_obj: deepmd.dpmodel.descriptor.Descriptor | deepmd.dpmodel.descriptor.DescriptorBlock, link_obj: deepmd.dpmodel.descriptor.Descriptor | deepmd.dpmodel.descriptor.DescriptorBlock, model_prob: float = 1.0) None[source]#
Merge descriptor env mat stats from link_obj into base_obj.
Uses probability-weighted merging: merged = base_stats + link_stats * model_prob, where model_prob = link_prob / base_prob. Mutates base_obj.stats for chaining (3+ models).
- Parameters:
- base_obj
DescriptororDescriptorBlock The base descriptor whose stats will be updated.
- link_obj
DescriptororDescriptorBlock The linked descriptor whose stats will be merged in.
- model_prob
float The probability weight ratio (link_prob / base_prob).
- base_obj
- class deepmd.dpmodel.utils.env_mat_stat.EnvMatStat[source]#
Bases:
deepmd.utils.env_mat_stat.EnvMatStatA base class to store and calculate the statistics of the environment matrix.
- compute_stat(env_mat: dict[str, deepmd.dpmodel.array_api.Array]) dict[str, deepmd.utils.env_mat_stat.StatItem][source]#
Compute the statistics of the environment matrix for a single system.
- class deepmd.dpmodel.utils.env_mat_stat.EnvMatStatSe(descriptor: deepmd.dpmodel.descriptor.Descriptor | deepmd.dpmodel.descriptor.DescriptorBlock)[source]#
Bases:
EnvMatStatEnvironmental matrix statistics for the se_a/se_r environmental matrix.
- Parameters:
- descriptor
DescriptororDescriptorBlock The descriptor of the model.
- descriptor
- iter(data: list[dict[str, numpy.ndarray | list[tuple[int, int]]]]) collections.abc.Iterator[dict[str, deepmd.utils.env_mat_stat.StatItem]][source]#
Get the iterator of the environment matrix.