Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions deepmd/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,8 +456,8 @@ def docstring_parameter(*sub: Tuple[str, ...]):
sub: Tuple[str, ...]
list of strings that will be inserted into prepared locations in docstring.

Note
----
Notes
-----
Can be used on both object and classes.
"""

Expand Down
2 changes: 2 additions & 0 deletions deepmd/model/model_stat.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ def _make_all_stat_ref(data, nbatches):
def make_stat_input(data, nbatches, merge_sys = True):
"""
pack data for statistics

Parameters
----------
data:
The data
merge_sys: bool (True)
Merge system data

Returns
-------
all_stat:
Expand Down
4 changes: 2 additions & 2 deletions deepmd/op/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
def import_ops():
"""Import all custom TF ops that are present in this submodule.

Note
----
Notes
-----
Initialy this subdir is unpopulated. CMake will install all the op module python
files and shared libs.
"""
Expand Down
4 changes: 2 additions & 2 deletions deepmd/utils/batch_size.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
class AutoBatchSize:
"""This class allows DeePMD-kit to automatically decide the maximum
batch size that will not cause an OOM error.

Notes
-----
We assume all OOM error will raise :metd:`OutOfMemoryError`.
We assume all OOM error will raise :class:`OutOfMemoryError`.

Parameters
----------
Expand Down
7 changes: 5 additions & 2 deletions deepmd/utils/data_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,14 +205,17 @@ def add_dict(self, adict: dict) -> None:
"""
Add items to the data system by a `dict`.
`adict` should have items like
adict[key] = {
.. 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`
"""
for kk in adict :
Expand Down
6 changes: 3 additions & 3 deletions deepmd/utils/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def glob(self, pattern: str) -> List["DPPath"]:

@abstractmethod
def rglob(self, pattern: str) -> List["DPPath"]:
"""This is like calling :metd:`DPPath.glob()` with `**/` added in front
"""This is like calling :meth:`DPPath.glob()` with `**/` added in front
of the given relative pattern.

Parameters
Expand Down Expand Up @@ -161,7 +161,7 @@ def glob(self, pattern: str) -> List["DPPath"]:
return list([type(self)(p) for p in self.path.glob(pattern)])

def rglob(self, pattern: str) -> List["DPPath"]:
"""This is like calling :metd:`DPPath.glob()` with `**/` added in front
"""This is like calling :meth:`DPPath.glob()` with `**/` added in front
of the given relative pattern.

Parameters
Expand Down Expand Up @@ -277,7 +277,7 @@ def glob(self, pattern: str) -> List["DPPath"]:
return list([type(self)("%s#%s"%(self.root_path, pp)) for pp in globfilter(subpaths, self._connect_path(pattern))])

def rglob(self, pattern: str) -> List["DPPath"]:
"""This is like calling :metd:`DPPath.glob()` with `**/` added in front
"""This is like calling :meth:`DPPath.glob()` with `**/` added in front
of the given relative pattern.

Parameters
Expand Down
4 changes: 2 additions & 2 deletions deepmd/utils/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ def __add__(self, other) -> "Plugin":
def register(self, key : str) -> Callable[[object], object]:
"""Register a plugin.

Parameter
---------
Parameters
----------
key : str
key of the plugin

Expand Down
2 changes: 1 addition & 1 deletion doc/development/type-embedding.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ $$E = F( [ \text{Multi}( \mathcal G( [s_{ij}, A(j)] ) ), A(j)] )$$
The difference between two variants above is whether using the information of centric atom when generating the descriptor. Users can choose by modifying the `type_one_side` hyper-parameter in the input json file.

## How to use
A detailed introduction can be found at [`se_e2_a_tebd`](../train-se-e2-a-tebd.md). Looking for a fast start up, you can simply add a `type_embedding` section in the input json file as displayed in the following, and the algorithm will adopt atom type embedding algorithm automatically.
A detailed introduction can be found at [`se_e2_a_tebd`](../model/train-se-e2-a-tebd.md). Looking for a fast start up, you can simply add a `type_embedding` section in the input json file as displayed in the following, and the algorithm will adopt atom type embedding algorithm automatically.
An example of `type_embedding` is like
```json
"type_embedding":{
Expand Down
4 changes: 2 additions & 2 deletions doc/model/dplr.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The method of DPLR is described in [this paper][1]. One is recommended to read t

In the following, we take the DPLR model for example to introduce the training and LAMMPS simulation with the DPLR model. The DPLR model is training in two steps.

### Train a deep Wannier model for Wannier centroids
## Train a deep Wannier model for Wannier centroids

We use the deep Wannier model (DW) to represent the relative position of the Wannier centroid (WC) with the atom to which it is associated. One may consult the introduction of the [dipole model](train-fitting-tensor.md) for a detailed introduction. An example input `wc.json` and a small dataset `data` for tutorial purposes can be found in
```bash
Expand Down Expand Up @@ -38,7 +38,7 @@ The training and freezing can be started from the example directory by
dp train dw.json && dp freeze -o dw.pb
```

### Train the DPLR model
## Train the DPLR model

The training of the DPLR model is very similar to the standard short-range DP models. An example input script can be found in the example directory. The following section is introduced to compute the long-range energy contribution of the DPLR model, and modify the short-range DP model by this part.
```json
Expand Down
2 changes: 1 addition & 1 deletion doc/model/overall.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ DeePMD-kit implements the following descriptors:
5. [`hybrid`](train-hybrid.md): Concate a list of descriptors to form a new descriptor.

The fitting of the following physical properties are supported
1. [`ener`](train-energy.md): Fit the energy of the system. The force (derivative with atom positions) and the virial (derivative with the box tensor) can also be trained. See [the example](train-se-e2-a.md#loss).
1. [`ener`](train-energy.md): Fit the energy of the system. The force (derivative with atom positions) and the virial (derivative with the box tensor) can also be trained.
2. [`dipole`](train-fitting-tensor.md): The dipole moment.
3. [`polar`](train-fitting-tensor.md): The polarizability.
2 changes: 1 addition & 1 deletion doc/model/train-se-e2-a-tebd.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

We generate specific type embedding vector for each atom type, so that we can share one descriptor embedding net and one fitting net in total, which decline training complexity largely.

The training input script is similar to that of [`se_e2_a`](train-se-e2-a.md#the-training-input-script), but different by adding the `type_embedding` section.
The training input script is similar to that of [`se_e2_a`](train-se-e2-a.md), but different by adding the `type_embedding` section.

## Type embedding net
The `model` defines how the model is constructed, adding a section of type embedding net:
Expand Down
2 changes: 1 addition & 1 deletion doc/model/train-se-e2-r.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ A complete training input script of this example can be found in the directory
$deepmd_source_dir/examples/water/se_e2_r/input.json
```

The training input script is very similar to that of [`se_e2_a`](train-se-e2-a.md#the-training-input-script). The only difference lies in the `descriptor` section
The training input script is very similar to that of [`se_e2_a`](train-se-e2-a.md). The only difference lies in the `descriptor` section
```json
"descriptor": {
"type": "se_e2_r",
Expand Down
2 changes: 1 addition & 1 deletion doc/model/train-se-e3.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ A complete training input script of this example can be found in the directory
$deepmd_source_dir/examples/water/se_e3/input.json
```

The training input script is very similar to that of [`se_e2_a`](train-se-e2-a.md#the-training-input-script). The only difference lies in the `descriptor` section
The training input script is very similar to that of [`se_e2_a`](train-se-e2-a.md). The only difference lies in the `descriptor` section
```json
"descriptor": {
"type": "se_e3",
Expand Down
2 changes: 1 addition & 1 deletion doc/third-party/ipi.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### Run path-integral MD with i-PI
# Run path-integral MD with i-PI
The i-PI works in a client-server model. The i-PI provides the server for integrating the replica positions of atoms, while the DeePMD-kit provides a client named `dp_ipi` (or `dp_ipi_low` for low precision) that computes the interactions (including energy, force and virial). The server and client communicates via the Unix domain socket or the Internet socket. Installation instructions of i-PI can be found [here](../install/install-ipi.md). The client can be started by
```bash
i-pi input.xml &
Expand Down
8 changes: 4 additions & 4 deletions source/api_cc/include/DeepPot.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,16 +226,16 @@ class DeepPotModelDevi
~DeepPotModelDevi() ;
/**
* @brief DP model deviation constructor with initialization.
* @param[in] model The names of the frozen model files.
* @param[in] models The names of the frozen model files.
* @param[in] gpu_rank The GPU rank. Default is 0.
* @param[in] file_content The contents of the model files. If it is not empty, DP will read from the strings instead of the files.
* @param[in] file_contents The contents of the model files. If it is not empty, DP will read from the strings instead of the files.
**/
DeepPotModelDevi (const std::vector<std::string> & models, const int & gpu_rank = 0, const std::vector<std::string> & file_contents = std::vector<std::string>());
/**
* @brief Initialize the DP model deviation contrcutor.
* @param[in] model The names of the frozen model files.
* @param[in] models The names of the frozen model files.
* @param[in] gpu_rank The GPU rank. Default is 0.
* @param[in] file_content The contents of the model files. If it is not empty, DP will read from the strings instead of the files.
* @param[in] file_contents The contents of the model files. If it is not empty, DP will read from the strings instead of the files.
**/
void init (const std::vector<std::string> & models, const int & gpu_rank = 0, const std::vector<std::string> & file_contents = std::vector<std::string>());
public:
Expand Down
4 changes: 2 additions & 2 deletions source/api_cc/include/DeepTensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class DeepTensor
* @brief Deep Tensor constructor with initialization..
* @param[in] model The name of the frozen model file.
* @param[in] gpu_rank The GPU rank. Default is 0.
* @param[in] file_content The content of the model file. If it is not empty, DP will read from the string instead of the file.
* @param[in] name_scope Name scopes of operations.
**/
DeepTensor(const std::string & model,
const int & gpu_rank = 0,
Expand All @@ -27,7 +27,7 @@ class DeepTensor
* @brief Initialize the Deep Tensor.
* @param[in] model The name of the frozen model file.
* @param[in] gpu_rank The GPU rank. Default is 0.
* @param[in] file_content The content of the model file. If it is not empty, DP will read from the string instead of the file.
* @param[in] name_scope Name scopes of operations.
**/
void init (const std::string & model,
const int & gpu_rank = 0,
Expand Down