deepmd.utils.model_stat#
Attributes#
Functions#
| |
| Collect batches from a DeepmdDataSystem into a dict of lists. |
| Pack data for statistics using DeepmdDataSystem. |
|
Module Contents#
- deepmd.utils.model_stat.collect_batches(data: Any, nbatches: int, merge_sys: bool = True) dict[str, list[Any]][source]#
Collect batches from a DeepmdDataSystem into a dict of lists.
This is a low-level helper used by the TF backend and by
make_stat_input().- Parameters:
- Returns:
- all_stat:
A dictionary of list of list storing data for stat. if merge_sys == False data can be accessed by
all_stat[key][sys_idx][batch_idx][frame_idx]
- else merge_sys == True can be accessed by
all_stat[key][batch_idx][frame_idx]
- deepmd.utils.model_stat.make_stat_input(data: Any, nbatches: int) list[dict[str, numpy.ndarray]][source]#
Pack data for statistics using DeepmdDataSystem.
Collects nbatches batches from each system and concatenates them into a single dict per system. The returned format (
list[dict[str, np.ndarray]]) is backend-agnostic and can be consumed bycompute_or_load_statin dpmodel, pt_expt, and jax.- Parameters:
- data
The multi-system data manager (must support
get_nsystems()andget_batch(sys_idx=)).- nbatches
int Number of batches to collect per system.
- Returns:
list[dict[str,np.ndarray]]Per-system dicts with concatenated numpy arrays.