109 Star 881 Fork 1.5K

MindSpore/models

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
.gitee
.github
.ipynb_checkpoints
.jenkins
benchmark/ascend
community
how_to_contribute
official
research
3d/DeepLM
audio
cv
gflownets
gnn
hpc
deepbsde
m2n
molecular_dynamics
ascend310_infer
script
src
README.md
default_config.yaml
eval.py
export.py
postprocess.py
preprocess.py
requirements.txt
ocean_model
pafnucy
pfnn
pinns
l2o/hem-learning-to-cut
mm
nerf
nlp
recommend
rl
.gitkeep
README.md
README_CN.md
__init__.py
utils
.clang-format
.gitignore
CONTRIBUTING.md
CONTRIBUTING_CN.md
LICENSE
OWNERS
README.md
README_CN.md
克隆/下载
贡献代码
同步代码
Loading...
README

Contents

Description

Molecular Dynamics (MD) is playing an increasingly important role in the research of biology, pharmacy, chemistry, and materials science. The architecture is based on DeePMD, which using an NN scheme for MD simulations, which overcomes the limitations associated to auxiliary quantities like the symmetry functions or the Coulomb matrix. Each environment contains a number of atoms, whose local coordinates are arranged in a symmetry preserving way following the prescription of the Deep Potential method. According to the atomic position, atomic types and box tensor to construct energy.

Thanks a lot for DeePMD team's help.

[1] Paper: L Zhang, J Han, H Wang, R Car, W E. Deep potential molecular dynamics: a scalable model with the accuracy of quantum mechanics. Physical review letters 120 (14), 143001 (2018).

[2] Paper: H Wang, L Zhang, J Han, W E. DeePMD-kit: A deep learning package for many-body potential energy representation and molecular dynamics. Computer Physics Communications 228, 178-184 (2018).

Model Architecture

The overall network architecture of MD simulation is show below.

Link

Dataset

Dataset used: deepmodeling/deepmd-kit/examples/water/data

The data is generated by Quantum Espresso and the input of Quantum Espresso is set manually.

The directory structure of the dataset is as follows:

└─data
    ├─type.raw
    ├─set.000
    │   ├──box.npy
    │   ├──coord.npy
    │   ├──energy.npy
    │   └──force.npy
    ├─set.001
    ├─set.002
    └─set.003

In deepmodeling/deepmd-kit/source:

  • Use train/DataSystem.py to get d_coord and atype.
  • Use function compute_input_stats in train/DataSystem.py to get avg and std.
  • Use op/descrpt_se_a.cc to get d_nlist and nlist.
  • Save d_coord, d_nlist, atype, avg, std and nlist as Npz file for inference.

Environment Requirements

Script Description

Script and Sample Code

├── md
    ├── README.md                   # descriptions about MD
    ├── script
    │   ├── eval.sh                 # evaluation script
    ├── src
    │   ├── src
    │       ├── config.py           # Parameter config
    │       ├── moxing_adapter.py   # modelarts device configuration
    │       ├── device_adapter.py   # Device Config
    │       ├── local_adapter.py    # local device config
    │   ├── descriptor.py           # descriptor function
    │   └── network.py              # MD simulation architecture
    └── eval.py                     # evaluation interface
    └── default_config.yaml         # config file

Training Process

To Be Done

Evaluation Process

After installing MindSpore via the official website, you can start evaluation as follows:

python eval.py --dataset_path [DATASET_PATH] --checkpoint_path [CHECKPOINT_PATH] --baseline_path [BASELINE_PATH]

checkpoint can be trained by using DeePMD-kit, and convert into the ckpt of MindSpore.

310infer

Before inference, please refer to MindSpore Inference with C++ Deployment Guide to set environment variables.

Result

The infer result:

energy: -29944.03
atom_energy: -94.38766   -94.294426  -94.39194   -94.70758   -94.51311   -94.457954 ...
#  Example of using distributed training dpn on modelarts :
#  Data set storage method

#  ├── molecular_dynamics_dataset                               # dataset dir
#    ├──baseline.npz                                            # baseline dataset
#    ├──input_tensor.npz                                        # infer input dataset
#    ├──water_md.ckpt                                           # checkpoint

# Choose either a (modify yaml file parameters) or b (modelArts create training job to modify parameters) 。
# Example of using model inference on modelarts
# (1) Place the trained model to the corresponding position of the bucket。
# (2) chocie a or b。
#        a.set "enable_modelarts=True"
#          set "checkpoint_path=/cache/data/water_md.ckpt"
#          set "dataset_path=/cache/data/input_tensor.npz"
#          set "baseline_path=/cache/data/baseline.npz"

#       b. Add "enable_modelarts=True" parameter on the interface of modearts。
#          Set the parameters required by method a on the modelarts interface
#          Note: The path parameter does not need to be quoted

# (3) Set the path of the network configuration file "_config_path=/The path of config in default_config.yaml/"
# (4) Set the code path on the modelarts interface "/path/molecular_dynamics"。
# (5) Set the model's startup file on the modelarts interface "eval.py" 。
# (6) Set the data path of the model on the modelarts interface ".../molecular_dynamics"(choices molecular_dynamics Folder path) ,
# The output path of the model "Output file path" and the log path of the model "Job log path"  。
# (7) Start model inference。

ModelZoo Homepage

Please check the official homepage.

马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mindspore/models.git
git@gitee.com:mindspore/models.git
mindspore
models
models
master

搜索帮助