deepmd.utils.data_system
Module Contents
Classes
Class for manipulating many data systems. |
Functions
| |
| Print summary of systems. |
| |
| |
| Process the user-input systems. |
| Get the data system. |
Attributes
- class deepmd.utils.data_system.DeepmdDataSystem(systems: List[str], batch_size: int, test_size: int, rcut: float | None = None, set_prefix: str = 'set', shuffle_test: bool = True, type_map: List[str] | None = None, optional_type_map: bool = True, modifier=None, trn_all_set=False, sys_probs=None, auto_prob_style='prob_sys_size', sort_atoms: bool = True)[source]
Class for manipulating many data systems.
It is implemented with the help of DeepmdData
- property default_mesh: List[numpy.ndarray][source]
Mesh for each system.
- add_dict(adict: dict) None [source]
Add items to the data system by a dict. adict should have items like .. code-block:: python.
- adict[key] = {
“ndof”: ndof, “atomic”: atomic, “must”: must, “high_prec”: high_prec, “type_sel”: type_sel, “repeat”: repeat,
}
For the explaination of the keys see add
- add(key: str, ndof: int, atomic: bool = False, must: bool = False, high_prec: bool = False, type_sel: List[int] | None = None, repeat: int = 1, default: float = 0.0, dtype: numpy.dtype | None = None, output_natoms_for_type_sel: bool = False)[source]
Add a data item that to be loaded.
- Parameters:
- key
The key of the item. The corresponding data is stored in sys_path/set.*/key.npy
- ndof
The number of dof
- atomic
The item is an atomic property. If False, the size of the data should be nframes x ndof If True, the size of data should be nframes x natoms x ndof
- must
The data file sys_path/set.*/key.npy must exist. If must is False and the data file does not exist, the data_dict[find_key] is set to 0.0
- high_prec
Load the data and store in float64, otherwise in float32
- type_sel
Select certain type of atoms
- repeat
The data will be repeated repeat times.
- default, default=0.
Default value of data
- dtype
The dtype of data, overwrites high_prec if provided
- output_natoms_for_type_selbool
If True and type_sel is True, the atomic dimension will be natoms instead of nsel
- reduce(key_out, key_in)[source]
Generate a new item from the reduction of another atom.
- Parameters:
- key_out
The name of the reduced item
- key_in
The name of the data item to be reduced
- get_batch(sys_idx: int | None = None) dict [source]
Get a batch of data from the data systems.
- Parameters:
- sys_idx
int
The index of system from which the batch is get. If sys_idx is not None, sys_probs and auto_prob_style are ignored If sys_idx is None, automatically determine the system according to sys_probs or auto_prob_style, see the following. This option does not work for mixed systems.
- sys_idx
- Returns:
dict
The batch data
- get_batch_standard(sys_idx: int | None = None) dict [source]
Get a batch of data from the data systems in the standard way.
- get_batch_mixed() dict [source]
Get a batch of data from the data systems in the mixed way.
- Returns:
dict
The batch data
- get_test(sys_idx: int | None = None, n_test: int = -1)[source]
Get test data from the the data systems.
- Parameters:
- sys_idx
The test dat of system with index sys_idx will be returned. If is None, the currently selected system will be returned.
- n_test
Number of test data. If set to -1 all test data will be get.
- get_sys_ntest(sys_idx=None)[source]
Get number of tests for the currently selected system, or one defined by sys_idx.
- get_sys(idx: int) deepmd.utils.data.DeepmdData [source]
Get a certain data system.
- deepmd.utils.data_system.print_summary(name: str, nsystems: int, system_dirs: List[str], natoms: List[int], batch_size: List[int], nbatches: List[int], sys_probs: List[float], pbc: List[bool])[source]
Print summary of systems.
- Parameters:
- name
str
The name of the system
- nsystems
int
The number of systems
- system_dirs
list
of
str
The directories of the systems
- natoms
list
of
int
The number of atoms
- batch_size
list
of
int
The batch size
- nbatches
list
of
int
The number of batches
- sys_probs
list
of
float
The probabilities
- pbc
list
of
bool The periodic boundary conditions
- name
- deepmd.utils.data_system.process_systems(systems: str | List[str]) List[str] [source]
Process the user-input systems.
If it is a single directory, search for all the systems in the directory. Check if the systems are valid.
- deepmd.utils.data_system.get_data(jdata: Dict[str, Any], rcut, type_map, modifier, multi_task_mode=False) DeepmdDataSystem [source]
Get the data system.
- Parameters:
- jdata
The json data
- rcut
The cut-off radius, not used
- type_map
The type map
- modifier
The data modifier
- multi_task_mode
If in multi task mode
- Returns:
DeepmdDataSystem
The data system