Commit 09f7d2bd authored by yuhai's avatar yuhai
Browse files

Update README.md

parent a69fc6be
# DeePKS-kit # DeePKS-kit(Deep Kohn-Sham)
# 模型介绍 # 模型介绍
DeePKS-kit是一个为量子化学系统生成精确能量泛函的程序 DeePKS-kit是一个为量子化学系统生成精确能量泛函的程序,DeePKS通过机器学习对于低精度的DFT泛函进行优化,利用神经网络修正项去学习基线泛函(低精度、低成本)与目标第一性原理方法(高精度、高成本)计算得出的能量与力的差值。
# 模型结构 # 模型结构
DeePKS-kit架构和工作流程的示意图[1]。上图:整个迭代学习过程的主要步骤。左下:神经网络NN能量泛数的训练。描述符由给定的分子轨道计算出来,并用作神经网络模型的输入。使用PyTorch库实现了随机梯度体面(SGD)训练。右下:求解广义的Kohn-Sham自洽场(自洽场)方程。XC电位是根据训练后的神经网络函数计算出来的。该求解器被实现为PySCF库的一个新类 DeePKS-kit一端与PyTorch接口,另一端与PySCF接口,PySCF是一个从头算计算化学程序,为量子化学代码开发和计算提供了一个简单、轻量级、高效的平台。DeePKS-kit支持作者之前开发的DeePHF和DeePKS方法。此外,它还提供了一定的灵活性,例如,修改模型结构,改变训练方案,接口其他量子化学包等。DeePKS-kit由三个主要模块组成,处理以下任务:(1)使用预先计算的描述符和标签训练(微扰)神经网络(NN)能量函数;(2)利用所提供的能量泛函求解给定系统的自洽场方程;(3)通过迭代调用任务(1)和(2)来学习自一致的能量函数
The program provides a command line interface `deepks` that contains five sub-commands, ![](./assets/deepks-kit.png)
- `train`: train an neural network based post-HF energy functional model
- `test`: test the post-HF model with given data and show statistics
- `scf`: run self-consistent field calculation with given energy model
- `stats`: collect and print statistics of the SCF the results
- `iterate`: iteratively train an self-consistent model by combining four commands above
# 数据集 DeePKS-kit架构示意图及工作流程如上图,上图说明了整个迭代学习过程的主要步骤。其中,左下是神经网络(NN)能量函数的训练。描述符从给定的分子轨道计算,并用作神经网络模型的输入。随机梯度下降(SGD)训练是使用PyTorch库实现的。右下是求解广义Kohn-Sham自洽场(SCF)方程。从训练好的神经网络泛函中计算XC电位。求解器是作为PySCF库的一个新类实现的。DeePKS-kit还提供了一个用户友好的界面,将上述模块与一些辅助功能组合成一个命令行工具。其中包含五个子命令: 
`train`: 训练基于神经网络的后高频能量泛函模型
`test`: 使用给定数据测试后高频模型并显示统计数据
`scf`: 使用给定的能量模型运行自洽场计算
`stats`: 收集和打印云函数的统计结果
`iterate`: 通过组合上面的四个命令来迭代训练自洽模型
## Installation ## 环境配置
## 性能和准确率数据
DCU测试平台:Z100
NVIDIA测试平台:A800
**1)收敛性测试**
Deepks的输出结果文件为test.out文件,默认运行的epoch数为10000,从左到右输出的指标分别是训练步骤、训练损失、验证损失、学习率、训练时间、验证时间。其中截取了最后的epoch部分的数值,其中看DCU和A800最后的结果基本一致。
[DCU文件信息]
![](./assets/deepks-1.png)
![](./assets/deepks-2.png)
![](./assets/deepks-3.png)
![](./assets/deepks-4.png)
[A800的文件输出信息]
![](./assets/deepks-5.png)
![](./assets/deepks-6.png)
![](./assets/deepks-7.png)
![](./assets/deepks-8.png)
整体收敛趋势如下图所示,依次为DCU和GPU。
![](./assets/deepks-9.png)
![](./assets/deepks-10.png)
预测值与实际值对照如下,依次为DCU和GPU。
![](./assets/deepks-11.png)
![](./assets/deepks-12.png)
**2)性能测试**
具体性能对比如下表:
| DCU | GPU |
| ------ | ------ |
| cell | cell |
| cell | cell |
## 源码仓库及问题反馈
DeePKS-kit is a pure python library so it can be installed following the standard `git clone` then `pip install` procedure. Note that the two main requirements `pytorch` and `pyscf` will not be installed automatically so you will need to install them manually in advance. Below is a more detailed instruction that includes installing the required libraries in the environment. DeePKS-kit is a pure python library so it can be installed following the standard `git clone` then `pip install` procedure. Note that the two main requirements `pytorch` and `pyscf` will not be installed automatically so you will need to install them manually in advance. Below is a more detailed instruction that includes installing the required libraries in the environment.
...@@ -57,12 +94,3 @@ Check [this input file](./examples/water_cluster/args.yaml) for detailed explana ...@@ -57,12 +94,3 @@ Check [this input file](./examples/water_cluster/args.yaml) for detailed explana
[1] Chen, Y., Zhang, L., Wang, H. and E, W., 2020. Ground State Energy Functional with Hartree–Fock Efficiency and Chemical Accuracy. The Journal of Physical Chemistry A, 124(35), pp.7155-7165. [1] Chen, Y., Zhang, L., Wang, H. and E, W., 2020. Ground State Energy Functional with Hartree–Fock Efficiency and Chemical Accuracy. The Journal of Physical Chemistry A, 124(35), pp.7155-7165.
[2] Chen, Y., Zhang, L., Wang, H. and E, W., 2021. DeePKS: A Comprehensive Data-Driven Approach toward Chemically Accurate Density Functional Theory. Journal of Chemical Theory and Computation, 17(1), pp.170–181. [2] Chen, Y., Zhang, L., Wang, H. and E, W., 2021. DeePKS: A Comprehensive Data-Driven Approach toward Chemically Accurate Density Functional Theory. Journal of Chemical Theory and Computation, 17(1), pp.170–181.
<!-- ## TODO
- [ ] Print loss separately for E and F in training.
- [ ] Rewrite all `print` function using `logging`.
- [ ] Write a detailed README and more docs.
- [ ] Add unit tests. -->
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