diff --git a/doc/data/data-conv.md b/doc/data/data-conv.md index e185c1efd9..96a0cb4e30 100644 --- a/doc/data/data-conv.md +++ b/doc/data/data-conv.md @@ -50,3 +50,6 @@ $ ls box.raw coord.raw energy.raw force.raw set.000 set.001 set.002 type.raw virial.raw ``` It generates three sets `set.000`, `set.001` and `set.002`, with each set contains 2000 frames. One do not need to take care of the binary data files in each of the `set.*` directories. The path containing `set.*` and `type.raw` is called a *system*. + +If one needs to train a non-periodic system, an empty `nopbc` file should be put under the system directory. `box.raw` is not necessary is a non-periodic system. + diff --git a/doc/train/training-advanced.md b/doc/train/training-advanced.md index b1e8b73e1c..1f52534672 100644 --- a/doc/train/training-advanced.md +++ b/doc/train/training-advanced.md @@ -45,7 +45,7 @@ Other training parameters are given in the `training` section. } ``` The sections `"training_data"` and `"validation_data"` give the training dataset and validation dataset, respectively. Taking the training dataset for example, the keys are explained below: -* `systems` provide paths of the training data systems. DeePMD-kit allows you to provide multiple systems. This key can be a `list` or a `str`. +* `systems` provide paths of the training data systems. DeePMD-kit allows you to provide multiple systems with different numbers of atoms. This key can be a `list` or a `str`. * `list`: `systems` gives the training data systems. * `str`: `systems` should be a valid path. DeePMD-kit will recursively search all data systems in this path. * At each training step, DeePMD-kit randomly pick `batch_size` frame(s) from one of the systems. The probability of using a system is by default in proportion to the number of batches in the system. More optional are available for automatically determining the probability of using systems. One can set the key `auto_prob` to @@ -118,4 +118,4 @@ One can set other environmental variables: | Environment variables | Allowed value | Default value | Usage | | --------------------- | ---------------------- | ------------- | -------------------------- | -| DP_INTERFACE_PREC | `high`, `low` | `high` | Control high (double) or low (float) precision of training. | \ No newline at end of file +| DP_INTERFACE_PREC | `high`, `low` | `high` | Control high (double) or low (float) precision of training. | diff --git a/examples/nopbc/README.md b/examples/nopbc/README.md new file mode 100644 index 0000000000..9405d53877 --- /dev/null +++ b/examples/nopbc/README.md @@ -0,0 +1,8 @@ +## Example of training non-periodic data + +This is an example of training Deep Potential models using non-periodic data with flexible sizes. The example is extracted from the following reference. + +It's warned that the example data is of very limited amount, so it cannot be put into production. Full data set can be downloaded from the following reference. + +Zeng, J., Cao, L., Xu, M. et al. Complex reaction processes in combustion unraveled by neural network-based molecular dynamics simulation. Nat Commun 11, 5713 (2020). DOI: [10.1038/s41467-020-19497-z](https://doi.org/10.1038/s41467-020-19497-z) + diff --git a/examples/nopbc/data/C1H4O2/nopbc b/examples/nopbc/data/C1H4O2/nopbc new file mode 100644 index 0000000000..e69de29bb2 diff --git a/examples/nopbc/data/C1H4O2/set.000/coord.npy b/examples/nopbc/data/C1H4O2/set.000/coord.npy new file mode 100644 index 0000000000..4a5137d7ac Binary files /dev/null and b/examples/nopbc/data/C1H4O2/set.000/coord.npy differ diff --git a/examples/nopbc/data/C1H4O2/set.000/energy.npy b/examples/nopbc/data/C1H4O2/set.000/energy.npy new file mode 100644 index 0000000000..4565fe90f3 Binary files /dev/null and b/examples/nopbc/data/C1H4O2/set.000/energy.npy differ diff --git a/examples/nopbc/data/C1H4O2/set.000/force.npy b/examples/nopbc/data/C1H4O2/set.000/force.npy new file mode 100644 index 0000000000..083f273aac Binary files /dev/null and b/examples/nopbc/data/C1H4O2/set.000/force.npy differ diff --git a/examples/nopbc/data/C1H4O2/type.raw b/examples/nopbc/data/C1H4O2/type.raw new file mode 100644 index 0000000000..95403e65a8 --- /dev/null +++ b/examples/nopbc/data/C1H4O2/type.raw @@ -0,0 +1,7 @@ +1 +1 +1 +1 +0 +2 +2 diff --git a/examples/nopbc/data/C1H4O2/type_map.raw b/examples/nopbc/data/C1H4O2/type_map.raw new file mode 100644 index 0000000000..76d5ec5097 --- /dev/null +++ b/examples/nopbc/data/C1H4O2/type_map.raw @@ -0,0 +1,3 @@ +C +H +O diff --git a/examples/nopbc/data/C3H3O4/nopbc b/examples/nopbc/data/C3H3O4/nopbc new file mode 100644 index 0000000000..e69de29bb2 diff --git a/examples/nopbc/data/C3H3O4/set.000/coord.npy b/examples/nopbc/data/C3H3O4/set.000/coord.npy new file mode 100644 index 0000000000..04de10df33 Binary files /dev/null and b/examples/nopbc/data/C3H3O4/set.000/coord.npy differ diff --git a/examples/nopbc/data/C3H3O4/set.000/energy.npy b/examples/nopbc/data/C3H3O4/set.000/energy.npy new file mode 100644 index 0000000000..25af5284ed Binary files /dev/null and b/examples/nopbc/data/C3H3O4/set.000/energy.npy differ diff --git a/examples/nopbc/data/C3H3O4/set.000/force.npy b/examples/nopbc/data/C3H3O4/set.000/force.npy new file mode 100644 index 0000000000..9c8ac93ef2 Binary files /dev/null and b/examples/nopbc/data/C3H3O4/set.000/force.npy differ diff --git a/examples/nopbc/data/C3H3O4/type.raw b/examples/nopbc/data/C3H3O4/type.raw new file mode 100644 index 0000000000..bca0c2048a --- /dev/null +++ b/examples/nopbc/data/C3H3O4/type.raw @@ -0,0 +1,10 @@ +1 +1 +1 +0 +0 +0 +2 +2 +2 +2 diff --git a/examples/nopbc/data/C3H3O4/type_map.raw b/examples/nopbc/data/C3H3O4/type_map.raw new file mode 100644 index 0000000000..76d5ec5097 --- /dev/null +++ b/examples/nopbc/data/C3H3O4/type_map.raw @@ -0,0 +1,3 @@ +C +H +O diff --git a/examples/nopbc/data/C4H3O1/nopbc b/examples/nopbc/data/C4H3O1/nopbc new file mode 100644 index 0000000000..e69de29bb2 diff --git a/examples/nopbc/data/C4H3O1/set.000/coord.npy b/examples/nopbc/data/C4H3O1/set.000/coord.npy new file mode 100644 index 0000000000..528d95fefb Binary files /dev/null and b/examples/nopbc/data/C4H3O1/set.000/coord.npy differ diff --git a/examples/nopbc/data/C4H3O1/set.000/energy.npy b/examples/nopbc/data/C4H3O1/set.000/energy.npy new file mode 100644 index 0000000000..4af103e9d9 Binary files /dev/null and b/examples/nopbc/data/C4H3O1/set.000/energy.npy differ diff --git a/examples/nopbc/data/C4H3O1/set.000/force.npy b/examples/nopbc/data/C4H3O1/set.000/force.npy new file mode 100644 index 0000000000..53d2a99032 Binary files /dev/null and b/examples/nopbc/data/C4H3O1/set.000/force.npy differ diff --git a/examples/nopbc/data/C4H3O1/type.raw b/examples/nopbc/data/C4H3O1/type.raw new file mode 100644 index 0000000000..9874003f15 --- /dev/null +++ b/examples/nopbc/data/C4H3O1/type.raw @@ -0,0 +1,8 @@ +1 +1 +1 +0 +0 +0 +0 +2 diff --git a/examples/nopbc/data/C4H3O1/type_map.raw b/examples/nopbc/data/C4H3O1/type_map.raw new file mode 100644 index 0000000000..76d5ec5097 --- /dev/null +++ b/examples/nopbc/data/C4H3O1/type_map.raw @@ -0,0 +1,3 @@ +C +H +O diff --git a/examples/nopbc/train/input.json b/examples/nopbc/train/input.json new file mode 100644 index 0000000000..f1f06da3f8 --- /dev/null +++ b/examples/nopbc/train/input.json @@ -0,0 +1,60 @@ +{ + "_comment": " model parameters", + "model": { + "type_map": ["C", "H", "O"], + "descriptor" :{ + "type": "se_e2_a", + "sel": [40, 80, 40], + "rcut_smth": 1.00, + "rcut": 6.00, + "neuron": [25, 50, 100], + "resnet_dt": false, + "axis_neuron": 12, + "seed": 1, + "_comment": " that's all" + }, + "fitting_net" : { + "neuron": [240, 240, 240], + "resnet_dt": true, + "seed": 1, + "_comment": " that's all" + }, + "_comment": " that's all" + }, + + "learning_rate" :{ + "type": "exp", + "decay_steps": 4000, + "start_lr": 0.001, + "stop_lr": 3.51e-8, + "_comment": "that's all" + }, + + "loss" :{ + "type": "ener", + "start_pref_e": 0.02, + "limit_pref_e": 1, + "start_pref_f": 1000, + "limit_pref_f": 1, + "start_pref_v": 0, + "limit_pref_v": 0, + "_comment": " that's all" + }, + + "training" : { + "training_data": { + "systems": "../data/", + "batch_size": "auto", + "_comment": "that's all" + }, + "numb_steps": 4000000, + "seed": 10, + "disp_file": "lcurve.out", + "disp_freq": 100, + "save_freq": 1000, + "_comment": "that's all" + }, + + "_comment": "that's all" +} +