ML LOGFILE

每次激活机器学习的 VASP 运行(INCAR 包含 ML_LMLFF = .TRUE.)都会生成一个名为 ML_LOGFILE 的文件。在此日志文件中,系统以一种紧凑、人类可读且便于后处理的方式展示了设置摘要以及与机器学习相关物理量的发展过程。对于机器学习 VASP 运行,它对 OUTCAR 和 OSZICAR 文件中通常的第一性原理日志输出起到了补充作用。

文件布局#

机器学习日志文件分为多个部分,视觉上采用如下方式分隔:

* SECTION TITLE ****************************************************************************************************************************

... content ...

********************************************************************************************************************************************

日志部分的实际组成可能取决于机器学习的操作模式(参见 ML_MODE)。通常,开头会有几个部分描述估计的内存消耗、机器学习设置和预先存在的数据。接着是主循环,它分为一个头部和实际的循环主体,其中包含描述学习进度(ML_MODE = train)或预测(ML_MODE = run)的数据。最后,可能包含有关实际内存消耗和计时统计信息的部分。以下章节更详细地描述了日志文件各部分的内容:

内存消耗估计#

这通常是 ML_LOGFILE 的第一部分,包含基于启动时读取的 VASP 文件的内存需求的估计。在最简单的情况下(ML_MODE = train),它取决于 INCAR 和 POSCAR 文件中的设置。例如,预期的内存消耗可能会随 POSCAR 文件中存在的元素数量而变化。各种 INCAR 标签也会影响内存需求,例如 ML_MB 或 ML_MRB2。续算或预测运行(即带有 ML_AB 的 ML_MODE = train 或 ML_MODE = run)也可能会将 ML_AB 或 ML_FF 文件中的设置考虑在内。

* MEMORY INFORMATION ***********************************************************************************************************************

Estimated memory consumption for ML force field generation (MB):

Persistent allocations for force field        :    516.9
|
|-- CMAT for basis                            :     20.3
|-- FMAT for basis                            :    458.5
|-- DESC for basis                            :      2.6
|-- DESC product matrix                       :      2.3

Persistent allocations for ab initio data     :      8.1
|
|-- Ab initio data                            :      7.8
|-- Ab initio data (new)                      :      0.3

Temporary allocations for sparsification      :    460.9
|
|-- SVD matrices                              :    460.7

Other temporary allocations                   :     15.5
|
|-- Descriptors                               :      4.7
|-- Regression                                :      6.5
|-- Prediction                                :      4.2

Total memory consumption                      :   1001.4

********************************************************************************************************************************************

虽然上面列表中的各个项目本质上相当技术性,但最重要的数字给出在最后一行:Total memory consumption 近似估算了此次 VASP 运行期间的峰值内存使用量。然而,由于并非所有内存总是在同一时间分配,实际消耗可能会随时间而变化。

以下部分总结了每个部分采用哪种并行化方式:

scaLAPACK shared memory CMAT for basis x x FMAT for basis x DESC for basis x x DESC product matrix x Ab initio data Ab initio data (new) SVD matrices x Descriptors Regression x Prediction

标有 x(针对 scaLAPACK)的部分包含块循环分布数组,这些数组通常随所使用处理器数量的增加而呈几乎完美的线性扩展。用户会发现,通过增加处理器数量,该部分所需的内存量将显着下降(我们注意到 Descriptors 和 Prediction 的内存也会下降,但幅度很小,因为其中只有极少部分被分布式处理)。如果代码是为共享内存编译的(预编译选项 use_shmem),标记为 x(针对共享内存)的部分也会显示内存使用的显着减少。使用共享内存的风险在这里进行了说明。

Mind: 这仅是一个估计值,实际的内存需求甚至可能更高。此外,这只是 VASP 机器学习部分的内存使用量,在训练运行中,它会与第一性原理部分的内存相加。

机器学习设置#

本节概述了有关机器学习设置最重要的 INCAR 标签。这些标签按主题分组,表格布局提供了简短的描述、当前值和“状态指示器”(有关解释,请参见实际的节标题)。

* MACHINE LEARNING SETTINGS ****************************************************************************************************************

This section lists the available machine-learning related settings with a short description, their
selected values and the INCAR tags. The column between the value and the INCAR tag may contain a
"state indicator" highlighting the origin of the value. Here is a list of possible indicators:

 *     : (empty) Tag was not provided in the INCAR file, a default value was chosen automatically.
 * (I) : Value was provided in the INCAR file.
 * (i) : Value was provided in the INCAR file, deprecated tag.
 * (!) : A value found in the INCAR file was overwritten by the contents of the ML_FF file.
 * (?) : The value for this tag was never set (please report this to the VASP developers).

Tag values with associated units are given here in Angstrom/eV, if not specified otherwise.

Please refer to the VASP online manual for a detailed description of available INCAR tags.

General settings
--------------------------------------------------------------------------------------------------------------------------------------------
Machine learning operation mode in strings (supertag)                                                 :         REFIT (I) ML_MODE       
Machine learning operation mode                                                                       :             4     ML_ISTART     
Precontraction of weights on Kernel for fast execution (ML_ISTART=2 only), but no error estimation    :             T     ML_LFAST      
Controls the verbosity of the output at each MD step when machine learning is used                    :             1     ML_OUTPUT_MODE
Sets the output frequency at various places for ML_ISTART=2                                           :             1     ML_OUTBLOCK

 
Descriptor settings
--------------------------------------------------------------------------------------------------------------------------------------------
Radial descriptors:
-------------------
Cutoff radius of radial descriptors                                                                   :   5.00000E+00     ML_RCUT1
Gaussian width for broadening the atomic distribution for radial descriptors                          :   5.00000E-01     ML_SION1
Number of radial basis functions for atomic distribution for radial descriptors                       :             8     ML_MRB1

Angular descriptors:
--------------------
Cutoff radius of angular descriptors                                                                  :   5.00000E+00     ML_RCUT2
Gaussian width for broadening the atomic distribution for angular descriptors                         :   5.00000E-01     ML_SION2
Number of radial basis functions for atomic distribution for angular descriptors                      :             8     ML_MRB2
Maximum angular momentum quantum number of spherical harmonics used to expand atomic distributions    :             4     ML_LMAX2
...

现有第一性原理数据#

本节将出现在续算运行中(例如带有现有 ML_AB 的 ML_MODE = train),并总结在 ML_AB 文件中找到的第一性原理数据。

* AVAILABLE AB INITIO DATA *****************************************************************************************************************

Number of stored (maximum) ab initio structures:       114 (     1500)
 * System   1 :       114 , name: "Si cubic diamond 2x2x2 super cell"
 * System   2 :         0 , name: "Si cubic diamond 2x2x2 super cell"
Maximum number of atoms per element:
 * Element Si :        64

********************************************************************************************************************************************

主循环#

ML_LOGFILE 的核心部分是主循环:根据机器学习模式 ML_MODE,它包含在整个 VASP 运行期间收集的所有时间步(或其他迭代方案)的数据。主循环布局经过精心设计,旨在最大程度地减小文件大小,同时具备自描述性。为了实现这一点,它分为两部分:主循环头部中的描述块解释了可用数据并呈其在行和列中的排列方式。然后,主循环主体包含先前定义布局中的实际数据(主要是原始数字)。数据与其描述的分离避免了不必要的重复,并简化了后处理。

头部#

主循环头部由多个块组成,每个块引入随后在循环主体中出现的一行日志。在下面的示例中,描述了日志行 STATUS:将按给定的顺序有 8 列(也将单词 STATUS 计算在内)。这里还简要解释了每一列的含义。接下来,简要概述了具有 5 列的日志行 STDAB,依此类推…

* MAIN LOOP ********************************************************************************************************************************

# STATUS ###############################################################
# STATUS This line describes the overall status of each step.
# STATUS 
# STATUS nstep ..... MD time step or input structure counter
# STATUS state ..... One-word description of step action
# STATUS             - "accurate"  (1) : Errors are low, force field is used
# STATUS             - "threshold" (2) : Errors exceeded threshold, structure is sampled from ab initio
# STATUS             - "learning"  (3) : Stored configurations are used for training force field
# STATUS             - "critical"  (4) : Errors are high, ab initio sampling and learning is enforced
# STATUS             - "predict"   (5) : Force field is used in prediction mode only, no error checking
# STATUS is ........ Integer representation of above one-word description (integer in parenthesis)
# STATUS doabin .... Perform ab initio calculation (T/F)
# STATUS iff ....... Force field available (T/F, False after startup hints to possible convergence problems)
# STATUS nsample ... Number of steps since last reference structure collection (sample = T)
# STATUS ngenff .... Number of steps since last force field generation (genff = T)
# STATUS ###############################################################
# STATUS            nstep     state is doabin    iff   nsample    ngenff
# STATUS                2         3  4      5      6         7         8
# STATUS ###############################################################

# STDAB ####################################################################
# STDAB This line contains the standard deviation of the collected ab initio reference data.
# STDAB
# STDAB nstep ........ MD time step or input structure counter
# STDAB std_energy ... Standard deviation in energy (eV atom^-1)
# STDAB std_force .... Standard deviation in forces (eV Angst^-1)
# STDAB std_stress ... Standard deviation in stress (kB)
# STDAB ####################################################################
# STDAB             nstep       std_energy        std_force       std_stress
# STDAB                 2                3                4                5
# STDAB ####################################################################

...
Tip: 第二列始终是当前(时间)步。

主体#

紧接在头部之后,主循环主体呈现了 VASP 运行中收集的信息的时间序列。属于同一时间步的数据块被虚线隔开。在头部中描述的关键词(例如 STDAB)位于每行的开头。通常,STATUS 行位于每个时间步块的开头,总结了在此步骤中发生的操作。在下面的示例中,STATUS 行指示“learning”,即机器学习力场已重新训练。

...
--------------------------------------------------------------------------------
STATUS                 82 learning   3      T      T         0        72
LCONF                  82 Si      1222      1228
SPRSC                  82       129       129 Si      1228      1224
REGR                   82    1    1   1.27238822E+00   5.73175466E-02   7.83203623E-12 
REGR                   82    1    2   1.28510216E+00   5.73084508E-02   7.75332075E-12 
REGRF                  82    1    3   1.29486873E+00   5.73015362E-02   7.69391276E-12    2.23430718E+16   5.75166077E+09
STDAB                  82   1.28851006E-01   1.02791005E+00   1.07081172E+01
ERR                    82   1.21269596E-02   2.35740491E-01   4.40365370E+00
CFE                    82   2.71935242E-01   2.20681769E-01   7.30391193E-01
LASTE                  82   1.63070075E-02   2.66475855E-01   7.17595981E+00
BEE                    82   4.72039040E-05   1.03291046E-01   3.02999592E-02   9.56824349E-02   6.23077315E-01   4.66683801E-01
THRHIST                82    1   8.45535075E-02
THRHIST                82    2   8.99995395E-02
THRHIST                82    3   9.42765991E-02
THRHIST                82    4   9.37027237E-02
THRHIST                82    5   9.78682111E-02
THRHIST                82    6   1.02991465E-01
THRHIST                82    7   1.04972577E-01
THRHIST                82    8   1.02574658E-01
THRHIST                82    9   9.68150073E-02
THRHIST                82   10   8.90700596E-02
THRUPD                 82   9.54674570E-02   9.56824349E-02   6.60216623E-02   1.06906899E-02
BEEF                   82   4.58511233E-05   9.95065359E-02   2.94732909E-02   9.56824349E-02   6.03276708E-01   4.51396163E-01
--------------------------------------------------------------------------------
...

但是请注意,每个时间步中的行数和组成并不是固定的,取决于执行的实际程序。例如,下面较短的块仅包含一个 STATUS 和 BEEF 行,因为机器学习力场仅用于预测(由“accurate”指示),因此仅计算了贝叶斯误差估计(BEEF 行):

...
--------------------------------------------------------------------------------
STATUS                 63 accurate   1      F      T         3        53
BEEF                   63   4.67236540E-05   1.09788403E-01   2.90204790E-02   9.56824349E-02   6.29349214E-01   4.74949548E-01
--------------------------------------------------------------------------------
...

计时信息#

最后一部分提供不同机器学习程序部分的计时(不考虑第一性原理代码部分)。系统时钟(墙上时间)和 CPU 时间(对进程的所有线程求和)有单独的列。

* TIMING INFORMATION ***********************************************************************************************************************

Program part                                         system clock (sec)       cpu time (sec)
---------------------------------------------------|--------------------|-------------------
Setup (file I/O, parameters,...)                   |              0.242 |              0.240
Descriptor and design matrix                       |             10.540 |             10.536
Sparsification of configurations                   |              9.183 |              9.177
Regression                                         |             14.778 |             14.770
Prediction                                         |             32.461 |             32.450
---------------------------------------------------|--------------------|-------------------
TOTAL                                              |             67.204 |             67.173

********************************************************************************************************************************************

后处理用法#

尽管主循环设计乍一看很复杂,但它服务于一个重要目的:直接的后处理。只需通过“搜索”相应的关键词,就可以从 ML_LOGFILE 中轻松构建特定量的时间序列。例如,通过提取所有以关键词 ERR 开头的行来生成预测误差的演变。在 Linux 中,这可以通过命令行工具 grep 完成:

grep ERR ML_LOGFILE

Windows 中 grep 的替代方法是 Powershell 中的 Select-String 工具:

Select-String -CaseSensitive -Pattern "ERR" ML_LOGFILE | select-object -ExpandProperty Line

这将把主循环头部和主体的内容组合为以下结果:

# ERR ######################################################################
# ERR This line contains the RMSEs of the predictions with respect to ab initio results for the training data.
# ERR 
# ERR nstep ......... MD time step or input structure counter
# ERR rmse_energy ... RMSE of energies (eV atom^-1)
# ERR rmse_force .... RMSE of forces (eV Angst^-1)
# ERR rmse_stress ... RMSE of stress (kB)
# ERR ######################################################################
# ERR               nstep      rmse_energy       rmse_force      rmse_stress
# ERR                   2                3                4                5
# ERR ######################################################################
ERR                     2   8.77652825E-05   1.00592308E-02   2.68800480E-02
ERR                     3   3.01865279E-05   1.06283576E-02   5.81209819E-02
ERR                     4   1.52820686E-04   1.31384993E-02   1.10439716E-01
ERR                     5   1.62739008E-04   1.74252575E-02   1.40488725E-01
ERR                     6   2.97462508E-04   2.32615279E-02   1.79092561E-01
ERR                     7   2.10891509E-04   2.79123925E-02   1.94566420E-01
ERR                     8   3.26150852E-04   3.15081244E-02   1.76637577E-01
ERR                     9   7.03479132E-04   3.42249550E-02   1.66830771E-01
ERR                    10   2.41808229E-04   3.54422133E-02   1.80246157E-01
ERR                    11   2.46299647E-04   3.70102675E-02   2.01262013E-01
ERR                    12   3.57654922E-04   3.93143970E-02   2.20533745E-01
ERR                    14   1.95974374E-04   4.31813231E-02   2.44026531E-01
ERR                    15   4.94080997E-04   4.73774930E-02   2.74308998E-01
ERR                    16   9.62150633E-04   5.07005683E-02   3.17482301E-01
ERR                    18   1.31336233E-03   5.39222716E-02   3.25526268E-01
ERR                    21   1.07020831E-03   5.67663475E-02   3.04995023E-01
ERR                    24   9.88977484E-04   6.37987961E-02   3.83686143E-01
ERR                    26   9.63361971E-04   6.81972633E-02   4.92021943E-01
ERR                    29   1.81730719E-03   7.47758864E-02   6.38563225E-01

输出可以重定向到文件或通过管道传输到其他后处理工具中。例如,预测误差数据可以直接在 gnuplot 中绘制:首先,将输出重定向到文件:

grep ERR ML_LOGFILE > err.dat

然后,启动 gnuplot 并输入:

p 'err.dat' u 2:4 w l

以显示随时间步变化的力误差。

收集的数据#

在本节中,我们提供有关在 ML_LOGFILE 中收集的数据各个时间序列的附加深入信息。如上所述,文件中已经为每个关键词的每一列提供了简短的描述,例如

# ERR ######################################################################
# ERR This line contains the RMSEs of the predictions with respect to ab initio results for the training data.
# ...
# ERR rmse_force .... RMSE of forces (eV Angst^-1)
# ...
# ERR ######################################################################
# ERR               nstep      rmse_energy       rmse_force      rmse_stress
# ERR                   2                3                4                5
# ...

告诉我们 ERR 时间序列中的第 4 列对应于力预测的均方根误差。然而,这种说法还不够精准,因为人们可以写出几种不同的力 RMSE 定义(例如,对具有不同原子数的结构进行/不进行单独加权)。在这里,我们收集了这种无法直接集成到日志文件中的背景信息。

STDAB 行#

该时间序列显示了从第一性原理模拟收集的训练数据的能量、力和应力的标准差。每当在在线训练期间生成新的力场时,它都会更新(STATUS 行指示 learning 或 critical)。训练数据本身写入 ML_ABN 文件。假设在给定时间步,训练数据中有 $\displaystyle{ M }$ 个包含第一性原理数据(上标 $\displaystyle{ \mathsf{dft} }$)的结构。此外,我们定义:

  • 每种类型 $\displaystyle{ \tau }$ 的原子参考能量:$\displaystyle{ \quad e^{\mathsf{ref}}_\tau }$
  • 结构 $\displaystyle{ i }$ 中类型 $\displaystyle{ \tau }$ 的原子数:$\displaystyle{ \quad N_{i,\tau} }$

能量#

定义结构 $\displaystyle{ i }$ 中的原子参考能量之和

$\displaystyle{ \quad E^{\mathsf{ref}}_{i} = \sum_{\tau} N_{i,\tau} e^{\mathsf{ref}}_\tau }$

我们可以写出每个原子的平均能量

$\displaystyle{ \overline{e^{\mathsf{dft}}} = \frac{1}{M} \sum_{i=1}^{M} \frac{E^{\mathsf{dft}}_{i} - E^{\mathsf{ref}}_{i}}{N_i} }$

并最终表示在 STDAB 行中报告的能量标准差:

$\displaystyle{ \mathtt{STDAB}_E = \sigma_{E} = \sqrt{\frac{1}{M} \sum_{i=1}^{M} \left(\frac{E^{\mathsf{dft}}_{i} - E^{\mathsf{ref}}_{i}}{N_i} - \overline{e^{\mathsf{dft}}}\right)^2} }$

力#

类似地,利用分量 $\displaystyle{ \alpha }$ 的平均参考力

$\displaystyle{ \overline{F^{\mathsf{dft}}_{\alpha}} = \frac{1}{M} \sum_{i=1}^{M} \frac{1}{N_i} \sum_{j=1}^{N_i} F^{\mathsf{dft}}_{i,j,\alpha} \quad \mathrm{where} \quad \alpha \in \{x,y,z\} }$

我们可以定义分量力标准差

$\displaystyle{ \sigma_{F,\alpha} = \sqrt{\frac{1}{M} \sum_{i=1}^{M} \frac{1}{N_i} \sum_{j=1}^{N_i} \left(F^{\mathsf{dft}}_{i,j,\alpha} - \overline{F^{\mathsf{dft}}_{\alpha}}\right)^2} \quad \mathrm{where} \quad \alpha \in \{x,y,z\} }$

并通过均方根将它们组合起来,以获得 STDAB 行中的输出:

$\displaystyle{ \mathtt{STDAB}_F = \sqrt{ \frac{1}{M} \sum_{i=1}^{M} \frac{1}{3N_i} \sum_{j=1}^{N_i} \sum_{\alpha\in\{x,y,z\}} \left( F^{\mathsf{dft}}_{i,j,\alpha} - \overline{F^{\mathsf{dft}}_{\alpha}}\right)^2 } = \sqrt{ \frac{\sigma_{F,x}^2 + \sigma_{F,y}^2 + \sigma_{F,z}^2}{3} } }$

应力#

就像对力一样,我们分别定义六个应力分量的所有量。首先,平均应力

$\displaystyle{ \overline{S^{\mathsf{dft}}_{\alpha\beta}} = \frac{1}{M} \sum_{i=1}^{M} S^{\mathsf{dft}}_{\alpha\beta} \quad \mathrm{where} \quad \alpha\beta \in \{xx,yy,zz,xy,xz,yz\} }$

随后是分量标准差:

$\displaystyle{ \sigma_{S,\alpha\beta} = \sqrt{\frac{1}{M} \sum_{i=1}^{M} \left(S^{\mathsf{dft}}_{\alpha\beta} - \overline{S^{\mathsf{dft}}_{\alpha\beta}}\right)^2} \quad \mathrm{where} \quad \alpha\beta \in \{xx,yy,zz,xy,xz,yz\} }$

最后,我们在 STDAB 行中获得组合的(均方根)应力标准差:

$\displaystyle{ \mathtt{STDAB}_S = \sqrt{\frac{1}{6M} \sum_{i=1}^{M} \sum_{\alpha\beta} \left(S^{\mathsf{dft}}_{\alpha\beta} - \overline{S^{\mathsf{dft}}_{\alpha\beta}}\right)^2} = \sqrt{ \frac{\sigma_{S,xx}^2 + \sigma_{S,yy}^2 + \sigma_{S,zz}^2 + \sigma_{S,xy}^2 + \sigma_{S,xz}^2 + \sigma_{S,yz}^2}{6} } }$

子集标准差#

对于 ML_IWEIGHT = 3,平均值 $\displaystyle{ \overline{e^{\mathsf{dft}}} }$, $\displaystyle{ \overline{F^{\mathsf{dft}}_{\alpha}} }$, $\displaystyle{ \overline{S^{\mathsf{dft}}_{\alpha\beta}} }$ 以及各自的标准差 $\displaystyle{ \sigma_{E} }$, $\displaystyle{ \sigma_{F,\alpha} }$, $\displaystyle{ \sigma_{S,\alpha\beta} }$ 的计算会进行修改,以考虑训练数据中可能断开的区域。例如,考虑一个训练数据集,其中包含来自两种不同晶体结构(例如 fcc 和 bcc)的第一性原理分子动力学模拟的结构。相应的势能随后可能会聚集在两个平均值周围,中间隔着一个数据集中未表示的能量范围。直接从所有能量数据计算 $\displaystyle{ \sigma_{E} }$ 将导致对所需数据离散程度的过度估计。因此,归一化均方根误差($\displaystyle{ \mathtt{NORME}_E }$)也会导致不合理地低的值。沿集群分割标准差的计算,为每个子集计算单独的值,最后对两个集的标准差求平均值,这似乎是很自然的。通常,我们对异构数据集采用以下策略计算标准差:首先,根据原子类型、每种类型的原子数和系统名称,将训练数据分割为多个子集。有关数据集分割的详细信息,请参见 ML_IWEIGHT 和 ML_LUSE_NAMES。让我们假设我们现在有 $\displaystyle{ R }$ 个子集,其中集合 $\displaystyle{ r }$ 包含 $\displaystyle{ M_r }$ 个结构,即

$\displaystyle{ \sum_{r=1}^{R} M_r = M. }$

然后,通过替换

$\displaystyle{ \frac{1}{M} \sum_{i=1}^{M} \quad \rightarrow \quad \frac{1}{M_r} \sum_{i \in \mathsf{set}_r} }$

我们可以计算各个子集的能量、力和应力平均值 $\displaystyle{ \overline{e^{\mathsf{dft}}_r} }$, $\displaystyle{ \overline{F^{\mathsf{dft}}_{\alpha,r}} }$ 和 $\displaystyle{ \overline{S^{\mathsf{dft}}_{\alpha\beta,r}} }$。利用这些子集均值,并在标准差公式中使用相同的替换,我们获得子集标准差 $\displaystyle{ \sigma_{E,r} }$, $\displaystyle{ \sigma_{F,\alpha,r} }$, $\displaystyle{ \sigma_{S,\alpha\beta,r} }$。最后,我们采用均方根(二次平均值)来计算能量、力和应力的总体标准差:

$\displaystyle{ \sigma_{E} = \sqrt{ \frac{1}{R} \sum_{r=1}^{R} \sigma_{E,r}^2 } }$

$\displaystyle{ \sigma_{F,\alpha} = \sqrt{ \frac{1}{R} \sum_{r=1}^{R} \sigma_{F,\alpha,r}^2 } }$

$\displaystyle{ \sigma_{S,\alpha\beta} = \sqrt{ \frac{1}{R} \sum_{r=1}^{R} \sigma_{S,\alpha\beta,r}^2 } }$

这些是进入 ERR 和 NORME 计算的标准差。

ERR 行#

ERR 行列出了能量、力和应力预测相对于训练集中参考数据的均方根误差(RMSE)。第一性原理与预测值的并排比较可以在 ML_REG 文件中找到。在以下公式中,我们重用了 STDAB 节中的定义。此外,上标 $\displaystyle{ \mathsf{ml} }$ 用于表示由机器学习力场预测的值。

能量#

$\displaystyle{ \mathtt{ERR}_E = \sqrt{\frac{1}{M} \sum_{i=1}^{M} \left(\frac{E^{\mathsf{dft}}_{i} - E^{\mathsf{ml}}_{i}}{N_i}\right)^2} }$

力#

$\displaystyle{ \mathtt{ERR}_F = \sqrt{ \frac{1}{M} \sum_{i=1}^{M} \frac{1}{3N_i} \sum_{j=1}^{N_i} \sum_{\alpha\in\{x,y,z\}} \left( F^{\mathsf{ml}}_{i,j,\alpha} - F^{\mathsf{dft}}_{i,j,\alpha} \right)^2 } }$

应力#

$\displaystyle{ \mathtt{ERR}_S = \sqrt{\frac{1}{6M} \sum_{i=1}^{M} \sum_{\alpha\beta} \left(S^{\mathsf{ml}}_{\alpha\beta} - S^{\mathsf{dft}}_{\alpha\beta}\right)^2} }$

NORME 行#

Mind: 从 VASP 6.6.0 开始可用

以 NORME 关键词开头的日志行包含 ERR 行中给出的 RMSE 的归一化版本。这里使用的“归一化因子”是从训练数据计算出的标准差。该量有时简称为 NRMSE$\displaystyle{ \sigma }$ 或 RSR(RMSE-观测标准差比)。NORME 行中的值已经乘以 100%,即以百分比表示。

能量#

$\displaystyle{ \mathtt{NORME}_E = 100 \% \cdot \sqrt{\frac{1}{M} \sum_{i=1}^{M} \frac{\left(\frac{E^{\mathsf{dft}}_{i} - E^{\mathsf{ml}}_{i}}{N_i}\right)^2}{\sigma_E^2}} = 100 \% \cdot \frac{\mathtt{ERR}_E}{\mathtt{STDAB}_E} }$

力#

$\displaystyle{ \mathtt{NORME}_F = 100 \% \cdot \sqrt{ \frac{1}{M} \sum_{i=1}^{M} \frac{1}{3N_i} \sum_{j=1}^{N_i} \sum_{\alpha\in\{x,y,z\}} \frac{\left( F^{\mathsf{ml}}_{i,j,\alpha} - F^{\mathsf{dft}}_{i,j,\alpha} \right)^2}{\sigma_\mathtt{F,\alpha}^2}} }$

应力#

$\displaystyle{ \mathtt{NORME}_S = 100 \% \cdot \sqrt{\frac{1}{6M} \sum_{i=1}^{M} \sum_{\alpha\beta} \frac{\left(S^{\mathsf{ml}}_{\alpha\beta} - S^{\mathsf{dft}}_{\alpha\beta}\right)^2}{\sigma_\mathtt{S,\alpha\beta}^2}} }$

分类原子的力相关量#

Mind: 从 VASP 6.6.0 开始可用

ML_LOGFILE 输出行中给出的一些全局量(相对于训练集而言是全局的)也可按原子种类获取,即在额外的日志行中提供按类型解析的结果:

  • ERPS:分种类的力的 RMSE,对应于 ERR 中的全局力 RMSE
  • NEPS:分种类的力的 NRMSE$\displaystyle{ \sigma }$,对应于 NORME 中的全局力 NRMSE$\displaystyle{ \sigma }$
  • BEPS、BEFPS:分种类的力的贝叶斯误差估计,对应于力的全局贝叶斯误差估计 BEE、BEEF。
  • SPFPS、SPFFPS:分种类的力的溢出因子,对应于力的全局溢出因子 SF、SFF。

分种类量的计算方法是:在相应全局量的公式中,将对所有原子的求和替换为仅限于相同类型原子的求和,即,如果 $\displaystyle{ \mathsf{A}_{i,\tau} }$ 表示结构 $\displaystyle{ i }$ 中类型为 $\displaystyle{ \tau }$ 的原子索引集:

$\displaystyle{ \frac{1}{N_i} \sum_{j=1}^{N_i} \quad \rightarrow \quad \frac{1}{N_{i,\tau}} \sum_{j \in \mathsf{A}_{i,\tau}}. }$