deepmd.utils.finetune#
Attributes#
Classes#
Functions#
| Returns the mapping index of types in new_map to those in the old_map. |
| Return the remapped atom_exclude_types according to remap_index. |
| Return the remapped atom_exclude_types according to remap_index. |
Module Contents#
- class deepmd.utils.finetune.FinetuneRuleItem(p_type_map: list[str], type_map: list[str], model_branch: str = 'Default', random_fitting: bool = False, resuming: bool = False)[source]#
-
- get_index_mapping()[source]#
Returns the mapping index of newly defined types to those in the pretrained model.
- deepmd.utils.finetune.get_index_between_two_maps(old_map: list[str], new_map: list[str])[source]#
Returns the mapping index of types in new_map to those in the old_map.
- Parameters:
- Returns:
- index_map:
list[int] List contains len(new_map) indices, where index_map[i] is the index of new_map[i] in old_map. If new_map[i] is not in the old_map, the index will be i - len(new_map).
- has_new_type: bool
Whether there are unseen types in the new type_map. If True, some type related params in the model, such as statistics, need to be extended to have a length of len(old_map) + len(new_map) in the type related dimension. Then positive indices from 0 to len(old_map) - 1 will select old params of types in old_map, while negative indices from -len(new_map) to -1 will select new params of types in new_map.
- index_map:
- deepmd.utils.finetune.map_atom_exclude_types(atom_exclude_types: list[int], remap_index: list[int])[source]#
Return the remapped atom_exclude_types according to remap_index.
- Parameters:
- Returns: