ML IERR: Difference between revisions

From VASP Wiki
No edit summary
No edit summary
 
(19 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{DISPLAYTITLE:ML_IERR}}
{{DISPLAYTITLE:ML_IERR}}
{{DEF|ML_IERR|0|if {{TAG|ML_ISTART}}{{=}}2|1|otherwise}}
{{TAGDEF|ML_IERR|[integer]|0}}


Description: Calculation and output frequency of Bayesian error estimate.
Description: Calculation and output frequency of error estimates for {{TAG|ML_MODE}}=''RUN'' computations.
----
----
This tag is only available in the development version of VASP.
This tag sets the interval in units of molecular-dynamics steps at which the error estimates are written to the {{TAG|ML_LOGFILE}}. The error estimate is computed by utilizing the [[Machine learning force field: Theory#Spilling factor|spilling factor]] if a refit with {{TAG|ML_MODE}}=''REFIT'' was done. The [[Machine learning force field: Theory#Spilling factor|spilling factor]] is calculated for each atom in the current structure and the maximum among all atoms is written to the {{TAG|ML_LOGFILE}} file marked with <code>SFF</code>.  


This tag sets the distance of molecular-dynamics steps for which the Bayesian error estimates are calculated and written to the {{TAG|ML_LOGFILE}}. This means that in every {{TAG|ML_IERR}} steps an entry corresponding to the keyword <code>BEE</code> and/or <code>BEEF</code> is written. If learning is activated ({{TAG|ML_ISTART}}=0,1 or 2) Bayesian error estimation must be "on" at every molecular-dynamics step ({{TAG|ML_IERR}}=1 is required).
The [[Machine learning force field: Theory#Spilling factor|spilling factor]] measures the similarity of the local environment of each atom in the current structure to that of the local reference configurations of the force field. The values of the spilling factor are in the range <math>[0,1]</math>. If the atomic environment is "properly" represented by the local reference configurations the spilling factor approaches 0. Vice versa the [[Machine learning force field: Theory#Spilling factor|spilling factor]] quickly approaches 1, if the force field is extrapolating. Still, molecular dynamics trajectories in which the [[Machine learning force field: Theory#Spilling factor|spilling factor]] is mostly 1 might be usable, but the results should be checked carefully.


Only for {{TAG|ML_ISTART}}=2 can {{TAG|ML_IERR}} be freely chosen. For {{TAG|ML_IERR}}=0 the Bayesian error is never calculated (and also no line is written out). This is the default since for {{TAG|ML_ISTART}}=2 the Bayesian error estimation takes up a significant amount of the total calculation time.
The calculation of the spilling factor scales quadratically with the number of local reference configurations and linearly with the number of species. For force fields containing many species and/or local reference configurations, the evaluation time of the spilling factor becomes of the order of the evaluation of a single force computation or more. Since it is sufficient to monitor the error every  {{TAG|ML_IERR}} MD steps, the total time consumed by the evaluation of the spilling factor can become insignificantly compared to the total time.  


{{TAG|ML_IERR}}>0 can be also used with the fast execution mode {{TAG|ML_LFAST}}=.TRUE., but at each step where the Bayesian error estimation is carried out, the code has to switch to the slow version. So choosing a too-narrow distance for {{TAG|ML_IERR}} will result in a huge slowdown of the code.
In long molecular dynamics calculations, we recommend to use at least {{TAG|ML_IERR}}=20-100.
 
{{TAG|ML_IERR}} can be freely chosen only if {{TAG|ML_MODE}}=''RUN''. In any other calculation mode, if {{TAG|ML_IERR}} is not equal to 1, the code will exit with an error and provide an error description.
 
For calculations using force fields obtained by {{TAG|ML_MODE}}=''REFITBAYESIAN'' or without any refitting, the Bayesian error estimates of energy, forces and stress (<code>BEFF</code>) are additionally written out to the {{TAG|ML_LOGFILE}} file and their output frequency is also controlled by {{TAG|ML_IERR}}. Albeit having the advantage of an additional error estimate we still do not recommend using these force fields, since they are significantly slower than force fields obtained by {{TAG|ML_MODE}}=''FAST''.


== Related tags and articles ==
== Related tags and articles ==
{{TAG|ML_LMLFF}}, {{TAG|ML_ISTART}}, {{TAG|ML_LFAST}}, {{TAG|ML_OUTBLOCK}}, {{TAG|ML_OUTPUT_MODE}}
{{TAG|ML_LMLFF}}, {{TAG|ML_MODE}}, {{TAG|ML_LFAST}}, {{TAG|ML_OUTBLOCK}}, {{TAG|ML_OUTPUT_MODE}}, {{TAG|ML_CALGO}}
----
----
 
[[Category:INCAR tag]][[Category:Machine-learned force fields]]
[[Category:INCAR tag]][[Category:Machine-learned force fields]][[Category:Development version]]

Latest revision as of 14:38, 18 December 2024

ML_IERR = [integer]
Default: ML_IERR = 0 

Description: Calculation and output frequency of error estimates for ML_MODE=RUN computations.


This tag sets the interval in units of molecular-dynamics steps at which the error estimates are written to the ML_LOGFILE. The error estimate is computed by utilizing the spilling factor if a refit with ML_MODE=REFIT was done. The spilling factor is calculated for each atom in the current structure and the maximum among all atoms is written to the ML_LOGFILE file marked with SFF.

The spilling factor measures the similarity of the local environment of each atom in the current structure to that of the local reference configurations of the force field. The values of the spilling factor are in the range . If the atomic environment is "properly" represented by the local reference configurations the spilling factor approaches 0. Vice versa the spilling factor quickly approaches 1, if the force field is extrapolating. Still, molecular dynamics trajectories in which the spilling factor is mostly 1 might be usable, but the results should be checked carefully.

The calculation of the spilling factor scales quadratically with the number of local reference configurations and linearly with the number of species. For force fields containing many species and/or local reference configurations, the evaluation time of the spilling factor becomes of the order of the evaluation of a single force computation or more. Since it is sufficient to monitor the error every ML_IERR MD steps, the total time consumed by the evaluation of the spilling factor can become insignificantly compared to the total time.

In long molecular dynamics calculations, we recommend to use at least ML_IERR=20-100.

ML_IERR can be freely chosen only if ML_MODE=RUN. In any other calculation mode, if ML_IERR is not equal to 1, the code will exit with an error and provide an error description.

For calculations using force fields obtained by ML_MODE=REFITBAYESIAN or without any refitting, the Bayesian error estimates of energy, forces and stress (BEFF) are additionally written out to the ML_LOGFILE file and their output frequency is also controlled by ML_IERR. Albeit having the advantage of an additional error estimate we still do not recommend using these force fields, since they are significantly slower than force fields obtained by ML_MODE=FAST.

Related tags and articles

ML_LMLFF, ML_MODE, ML_LFAST, ML_OUTBLOCK, ML_OUTPUT_MODE, ML_CALGO