Module providing compatibility between 0.x.x and 1.x.x input versions.Module Contents
Functions
convert_input_v0_v1 (→ Dict[str, Any])
| Convert input from v0 format to v1. |
_warning_input_v0_v1 (fname)
| |
_model (→ Dict[str, Dict[str, Any]])
| Convert data to v1 input for non-smooth model. |
_nonsmth_descriptor (→ Dict[str, Any])
| Convert data to v1 input for non-smooth descriptor. |
_smth_descriptor (→ Dict[str, Any])
| Convert data to v1 input for smooth descriptor. |
_fitting_net (→ Dict[str, Any])
| Convert data to v1 input for fitting net. |
_learning_rate (→ Dict[str, Any])
| Convert data to v1 input for learning rate section. |
_loss (→ Dict[str, Any])
| Convert data to v1 input for loss function. |
_training (→ Dict[str, Any])
| Convert data to v1 input for training. |
_jcopy (src, dst, keys)
| Copy specified keys from one dict to another. |
remove_decay_rate (jdata)
| Convert decay_rate to stop_lr. |
convert_input_v1_v2 (→ Dict[str, Any])
| |
_warning_input_v1_v2 (fname)
| |
deprecate_numb_test (→ Dict[str, Any])
| Deprecate numb_test since v2.1. It has taken no effect since v2.0. |
update_deepmd_input (→ Dict[str, Any])
| |
- deepmd.utils.compat.convert_input_v0_v1(jdata: Dict[str, Any], warning: bool = True, dump: str | pathlib.Path | None = None) → Dict[str, Any][source]
Convert input from v0 format to v1.
- Parameters:
- jdata
Dict
[str
, Any
] loaded json/yaml file
- warningbool,
optional
whether to show deprecation warning, by default True
- dump
Optional
[Union
[str
, Path
]], optional
whether to dump converted file, by default None
- Returns:
Dict
[str
, Any
]converted output
- deepmd.utils.compat._warning_input_v0_v1(fname: str | pathlib.Path | None)[source]
- deepmd.utils.compat._model(jdata: Dict[str, Any], smooth: bool) → Dict[str, Dict[str, Any]][source]
Convert data to v1 input for non-smooth model.
- Parameters:
- jdata
Dict
[str
, Any
] parsed input json/yaml data
- smoothbool
whether to use smooth or non-smooth descriptor version
- Returns:
Dict
[str
, Dict
[str
, Any
]]dictionary with model input parameters and sub-dictionaries for descriptor and fitting net
- deepmd.utils.compat._nonsmth_descriptor(jdata: Dict[str, Any]) → Dict[str, Any][source]
Convert data to v1 input for non-smooth descriptor.
- Parameters:
- jdata
Dict
[str
, Any
] parsed input json/yaml data
- Returns:
Dict
[str
, Any
]dict with descriptor parameters
- deepmd.utils.compat._smth_descriptor(jdata: Dict[str, Any]) → Dict[str, Any][source]
Convert data to v1 input for smooth descriptor.
- Parameters:
- jdata
Dict
[str
, Any
] parsed input json/yaml data
- Returns:
Dict
[str
, Any
]dict with descriptor parameters
- deepmd.utils.compat._fitting_net(jdata: Dict[str, Any]) → Dict[str, Any][source]
Convert data to v1 input for fitting net.
- Parameters:
- jdata
Dict
[str
, Any
] parsed input json/yaml data
- Returns:
Dict
[str
, Any
]dict with fitting net parameters
- deepmd.utils.compat._learning_rate(jdata: Dict[str, Any]) → Dict[str, Any][source]
Convert data to v1 input for learning rate section.
- Parameters:
- jdata
Dict
[str
, Any
] parsed input json/yaml data
- Returns:
Dict
[str
, Any
]dict with learning rate parameters
- deepmd.utils.compat._loss(jdata: Dict[str, Any]) → Dict[str, Any][source]
Convert data to v1 input for loss function.
- Parameters:
- jdata
Dict
[str
, Any
] parsed input json/yaml data
- Returns:
Dict
[str
, Any
]dict with loss function parameters
- deepmd.utils.compat._training(jdata: Dict[str, Any]) → Dict[str, Any][source]
Convert data to v1 input for training.
- Parameters:
- jdata
Dict
[str
, Any
] parsed input json/yaml data
- Returns:
Dict
[str
, Any
]dict with training parameters
- deepmd.utils.compat._jcopy(src: Dict[str, Any], dst: Dict[str, Any], keys: Sequence[str])[source]
Copy specified keys from one dict to another.
- Parameters:
- src
Dict
[str
, Any
] source dictionary
- dst
Dict
[str
, Any
] destination dictionary, will be modified in place
- keys
Sequence
[str
] list of keys to copy
- deepmd.utils.compat.remove_decay_rate(jdata: Dict[str, Any])[source]
Convert decay_rate to stop_lr.
- Parameters:
- jdata
Dict
[str
, Any
] input data
- deepmd.utils.compat.convert_input_v1_v2(jdata: Dict[str, Any], warning: bool = True, dump: str | pathlib.Path | None = None) → Dict[str, Any][source]
- deepmd.utils.compat._warning_input_v1_v2(fname: str | pathlib.Path | None)[source]
- deepmd.utils.compat.deprecate_numb_test(jdata: Dict[str, Any], warning: bool = True, dump: str | pathlib.Path | None = None) → Dict[str, Any][source]
Deprecate numb_test since v2.1. It has taken no effect since v2.0.
See #1243.
- Parameters:
- jdata
Dict
[str
, Any
] loaded json/yaml file
- warningbool,
optional
whether to show deprecation warning, by default True
- dump
Optional
[Union
[str
, Path
]], optional
whether to dump converted file, by default None
- Returns:
Dict
[str
, Any
]converted output
- deepmd.utils.compat.update_deepmd_input(jdata: Dict[str, Any], warning: bool = True, dump: str | pathlib.Path | None = None) → Dict[str, Any][source]