Commit 2ba793e4 authored by zhanggzh's avatar zhanggzh
Browse files

add torchani src code and change readme

parent 53f32530
# <img src=https://raw.githubusercontent.com/aiqm/torchani/master/logo1.png width=180/> Accurate Neural Network Potential on PyTorch
Metrics:
![PyPI](https://img.shields.io/pypi/v/torchani.svg)
![PyPI - Downloads](https://img.shields.io/pypi/dm/torchani.svg)
Checks:
[![CodeFactor](https://www.codefactor.io/repository/github/aiqm/torchani/badge/master)](https://www.codefactor.io/repository/github/aiqm/torchani/overview/master)
[![Total alerts](https://img.shields.io/lgtm/alerts/g/aiqm/torchani.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/aiqm/torchani/alerts/)
[![Actions Status](https://github.com/aiqm/torchani/workflows/flake8/badge.svg)](https://github.com/aiqm/torchani/actions)
[![Actions Status](https://github.com/aiqm/torchani/workflows/clang-format/badge.svg)](https://github.com/aiqm/torchani/actions)
[![Actions Status](https://github.com/aiqm/torchani/workflows/mypy/badge.svg)](https://github.com/aiqm/torchani/actions)
[![Actions Status](https://github.com/aiqm/torchani/workflows/unittests/badge.svg)](https://github.com/aiqm/torchani/actions)
[![Actions Status](https://github.com/aiqm/torchani/workflows/cuda/badge.svg)](https://github.com/aiqm/torchani/actions)
[![Actions Status](https://github.com/aiqm/torchani/workflows/docs/badge.svg)](https://github.com/aiqm/torchani/actions)
[![Actions Status](https://github.com/aiqm/torchani/workflows/runnable-submodules/badge.svg)](https://github.com/aiqm/torchani/actions)
[![Actions Status](https://github.com/aiqm/torchani/workflows/tools/badge.svg)](https://github.com/aiqm/torchani/actions)
Deploy:
[![Actions Status](https://github.com/aiqm/torchani/workflows/deploy-docs/badge.svg)](https://github.com/aiqm/torchani/actions)
[![Actions Status](https://github.com/aiqm/torchani/workflows/deploy-pypi/badge.svg)](https://github.com/aiqm/torchani/actions)
We only provide compatibility with nightly PyTorch, but you can check if stable PyTorch happens to be supported by looking at the following badge:
[![Actions Status](https://github.com/aiqm/torchani/workflows/stable-torch/badge.svg)](https://github.com/aiqm/torchani/actions)
TorchANI is a pytorch implementation of ANI. It is currently under alpha release, which means, the API is not stable yet. If you find a bug of TorchANI, or have some feature request, feel free to open an issue on GitHub, or send us a pull request.
<img src=https://raw.githubusercontent.com/aiqm/torchani/master/logo2.png width=500/>
# Install
TorchANI requires the latest preview version of PyTorch. Please install PyTorch before installing TorchANI.
Please see [PyTorch's official site](https://pytorch.org/get-started/locally/) for instructions of installing latest preview version of PyTorch.
Note that if you updated TorchANI, you may also need to update PyTorch.
After installing the correct PyTorch, you can install TorchANI by `pip` or `conda`:
```bash
pip install torchani
```
or
```bash
conda install -c conda-forge torchani
```
See https://github.com/conda-forge/torchani-feedstock for more information about the conda package.
To run the tests and examples, you must manually download a data package
```bash
./download.sh
# <div align="center"><strong>Torchani</strong></div>
## 简介
torchani 是一个基于 PyTorch 的神经网络势能(ANI)的开源实现。ANI 是一种利用深度学习模型来预测分子间相互作用力的方法,广泛应用于分子动力学模拟、化学反应路径探索等领域。torchani 的设计目标是提供一种高效、易于使用且高度可扩展的神经网络势能计算工具。
## 安装
源码编译安装,该方式需要安装torch及fastpt工具包;注意使用fastpt包进行源码编译安装时,要严格匹配fastpt、torch、dtk之间的版本号,例如基于dtk2504编译,则fastpt、torch都必须是dtk2504的包,其中fastpt与torch对应的版本号关系为
| | fastpt版本 | torch版本 | DTK版本 |
| - | -------- | ------- | ------------ |
| 1 | 2.0.1+das.dtk2504 | v2.4.1 | dtk2504|
| 1 | 2.1.0+das.dtk2504 | v2.5.1 | dtk2504|
| 1 | 2.0.1+das.dtk25041 | v2.4.1 | dtk25041|
| 1 | 2.1.0+das.dtk25041 | v2.5.1 | dtk25041|
## 编译流程
```
pip3 install pytest
pip3 install wheel
pip3 isntall ase
pip3 install fastpt-2.0.1+das.dtk2504-py3-none-any.whl #以torch2.4.1,dtk2504为例
git clone https://developer.sourcefind.cn/codes/OpenDAS/torchani.git
cd torchani
git checkout * #切换到相应分支
source /usr/local/bin/fastpt -c
python3 setup.py bdist_wheel --cuaev# 该指令用于编译whl包,执行该指令时不必执行前两个指令
```
## 验证安装
```
[CUAEV](https://github.com/aiqm/torchani/tree/master/torchani/cuaev) (Optional)
To install AEV CUDA Extension (speedup for AEV forward and backward), please follow the instruction at [torchani/cuaev](https://github.com/aiqm/torchani/tree/master/torchani/cuaev).
# Citation
Please cite the following paper if you use TorchANI
* Xiang Gao, Farhad Ramezanghorbani, Olexandr Isayev, Justin S. Smith, and Adrian E. Roitberg. *TorchANI: A Free and Open Source PyTorch Based Deep Learning Implementation of the ANI Neural Network Potentials*. Journal of Chemical Information and Modeling 2020 60 (7), 3408-3415, [![DOI for Citing](https://img.shields.io/badge/DOI-10.1021%2Facs.jcim.0c00451-green.svg)](https://doi.org/10.1021/acs.jcim.0c00451)
[![JCIM Cover](https://pubs.acs.org/na101/home/literatum/publisher/achs/journals/content/jcisd8/2020/jcisd8.2020.60.issue-7/jcisd8.2020.60.issue-7/20200727/jcisd8.2020.60.issue-7.largecover.jpg)](https://pubs.acs.org/toc/jcisd8/60/7)
* Please refer to [isayev/ASE_ANI](https://github.com/isayev/ASE_ANI) for ANI model references.
# ANI model parameters
All the ANI model parameters including (ANI2x, ANI1x, and ANI1ccx) are accessible from the following repositories:
- [isayev/ASE_ANI](https://github.com/isayev/ASE_ANI)
- [aiqm/ani-model-zoo](https://github.com/aiqm/ani-model-zoo)
# Develop
To install TorchANI from GitHub:
```bash
git clone https://github.com/aiqm/torchani.git
cd torchani
pip install -e .
pip3 list | grep torchani
python3
import torchani
torchani.__version__
#返回版本号
```
After TorchANI has been installed, you can build the documents by running `sphinx-build docs build`. But make sure you
install dependencies:
```bash
pip install -r docs_requirements.txt
## 测试
执行测试前需要执行download.sh脚本下载所需数据
```
source /usr/local/bin/fastpt -e
cd tests
pytest vs
To manually run unit tests, do
```bash
pytest -v
```
If you opened a pull request, you could see your generated documents at https://aiqm.github.io/torchani-test-docs/ after you `docs` check succeed.
Keep in mind that this repository is only for the purpose of convenience of development, and only keeps the latest push.
The CI runing for other pull requests might overwrite this repository. You could rerun the `docs` check to overwrite this repo to your build.
# Note to TorchANI developers
Never commit to the master branch directly. If you need to change something, create a new branch, submit a PR on GitHub.
You must pass all the tests on GitHub before your PR can be merged.
Code review is required before merging pull request.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment