nep.in
This file specifies hyperparameters used for training neuroevolution potential (NEP) models, the functional form of which is outlined here.
The NEP approach was proposed in [Fan2021] (NEP1) and later improved in [Fan2022a] (NEP2), [Fan2022b] (NEP3), and [Song2024] (NEP4).
Currently, only NEP4 is supported; the version keyword therefore only accepts 4.
File format
In this input file, blank lines and lines starting with # are ignored.
One can thus write comments after #.
All other lines need to be of the following form:
keyword parameter_1 parameter_2 ...
Keywords can appear in any order with the exception of the type_weight keyword, which cannot appear before the type keyword.
The type keyword does not have default parameters and must be set. All other keywords have default values.
Use model to select the model family, for example
model qnep2 or model qnep3_vdw. Omitting all model selectors selects
ordinary nep. Legacy selectors remain supported with deprecation warnings.
Keywords
Keyword |
Brief description |
|---|---|
select the NEP version (currently only NEP4) |
|
number of atom types and list of chemical species |
|
force weights for different atom types |
|
select the model for training or prediction |
|
legacy model selection (deprecated) |
|
legacy charge-model selection (deprecated) |
|
reverse charge-output weights when restarting charge-model training |
|
select between training and prediction (inference) |
|
outer cutoff for the universal ZBL potential [Ziegler1985] |
|
select the spin descriptor version for |
|
one spin cutoff or one cutoff per element, bounded by the NEP radial cutoff |
|
magnetic radial basis index followed by a reserved second value fixed at zero |
|
maximum spatial tensor rank used by the spin descriptor |
|
number of shared compressed radial channels |
|
highest Spin3 contraction level supplied to the neural network |
|
enable joint spin–space rotation-invariant Spin3 channels |
|
atom types with independent spin degrees of freedom |
|
enable typewise cutoff radii for the ZBL part of the model |
|
radial (\(r_\mathrm{c}^\mathrm{R}\)) and angular (\(r_\mathrm{c}^\mathrm{A}\)) cutoffs |
|
size of radial (\(n_\mathrm{max}^\mathrm{R}\)) and angular (\(n_\mathrm{max}^\mathrm{A}\)) basis |
|
number of radial (\(N_\mathrm{bas}^\mathrm{R}\)) and angular (\(N_\mathrm{bas}^\mathrm{A}\)) basis functions |
|
expansion order for angular terms |
|
number of neurons in the hidden layer (\(N_\mathrm{neu}\)) |
|
weight of \(\mathcal{L}_1\)-norm regularization term |
|
weight of \(\mathcal{L}_2\)-norm regularization term |
|
weight of energy loss term |
|
weight of force loss term |
|
weight of virial loss term |
|
weight of Cartesian magnetic-force loss term |
|
weight of parallel magnetic-force RMSE (requires |
|
weight of perpendicular magnetic-force RMSE (requires |
|
weight of spin-torque loss term |
|
weight of grouped magnetic-response loss term |
|
weight of total-charge loss term for qNEP models |
|
weight of Born-effective-charge loss term for qNEP models |
|
weight of energy-difference loss term, with the combinations in |
|
fit atomic or global virial |
|
extra weight of shear-virial loss terms |
|
bias term that can be used to make smaller forces more accurate |
|
batch size for training |
|
population size used in the SNES algorithm [Schaul2011] |
|
number of generations used by the SNES algorithm [Schaul2011] |
|
periodically save model checkpoints and, optionally, restart checkpoints |
|
interval between regular training-status and model/test-set outputs |
|
output normalized descriptors in prediction mode |
|
fine tune a model starting from a foundation model |
|
import descriptor normalization factors from an existing |
Consistency with model files already present
A training run writes both nep.txt and nep.restart every output_interval generations.
Each mismatch is reported on its own line, naming the keyword, the value used by the current run, whether that value was given in nep.in or is a default, and the value found in the file, for example:
The model in nep.in is inconsistent with nep.txt:
basis_size_radial: nep.in gives 6 (default), nep.txt gives 8.
basis_size_angular: nep.in gives 6 (default), nep.txt gives 8.
The same comparison is applied to the nep.txt read by the import_q_scaler keyword, where a mismatch is always an error.
Example
Here is an example nep.in file using all the default parameters:
type 2 Te Pb # this is a mandatory keyword
version 4 # the only option
cutoff 8 4 # please choose these reasonably
n_max 6 6 # default
basis_size 6 6 # default
l_max 4 1 # default
neuron 30 # default
lambda_e 1.0 # default
lambda_f 1.0 # default
lambda_v 0.1 # default
batch 1000 # default
population 50 # default
generation 100000 # default
For Spin training, see the spin_version example and the Spin potential documentation.