nep.in

This file selects the model and controls NEP training or prediction. For the model equations, see NEP formalism.

File format

Write one keyword per line:

keyword parameter_1 parameter_2 ...

Blank lines are ignored, and # starts a comment that extends to the end of the line. Put the required type keyword first, followed by the settings to change from their defaults. In particular, type must precede cutoff, type_weight, and spin_cutoff. All other keywords have defaults for ordinary NEP training.

Use model to select another model family, such as model qnep2. The default model is ordinary nep. Only NEP4 is supported, so version can be omitted or set to 4.

Example

The following input lists common settings for an ordinary Te-Pb NEP model explicitly. Apart from the required species list, the values shown are the defaults:

type        2 Te Pb
version     4
cutoff      8 4
n_max       6 6
basis_size  6 6
l_max       4 1
neuron      30
lambda_e    1.0
lambda_f    1.0
lambda_v    0.1
batch       1000
population  50
generation  100000

Choose the cutoffs and other model settings for the system and training data. For Spin training, see the spin_version example and Spin potential documentation.

Keywords

Keyword

Brief description

version

select the NEP version (currently only NEP4)

type

number of atom types and list of chemical species

type_weight

force weights for different atom types

model

select the model for training or prediction

flip_charge

reverse charge-output weights when restarting charge-model training

prediction

select between training and prediction (inference)

zbl

outer cutoff for the universal ZBL potential [Ziegler1985]

spin_version

select the spin descriptor version for model nep_spin

spin_cutoff

one spin cutoff or one cutoff per element, bounded by the NEP radial cutoff

spin_l_max

maximum spatial tensor rank used by the spin descriptor

spin_compress

number of shared compressed radial channels

spin_order

maximum polynomial degree of primitive spin inputs

spin_soc

enable joint spin–space rotation-invariant magnetic channels

spin_type

atom types with independent spin degrees of freedom

use_typewise_cutoff_zbl

enable typewise cutoff radii for the ZBL part of the model

cutoff

radial (\(r_\mathrm{c}^\mathrm{R}\)) and angular (\(r_\mathrm{c}^\mathrm{A}\)) cutoffs

n_max

radial-function index limits for radial and angular descriptors

basis_size

radial (\(N_\mathrm{bas}^\mathrm{R}\)) and angular (\(N_\mathrm{bas}^\mathrm{A}\)) basis sizes

l_max

expansion order for angular terms

neuron

number of neurons in the hidden layer (\(N_\mathrm{neu}\))

lambda_1

weight of \(\mathcal{L}_1\)-norm regularization term

lambda_2

weight of \(\mathcal{L}_2\)-norm regularization term

lambda_e

weight of energy loss term

lambda_f

weight of force loss term

lambda_v

weight of virial loss term

lambda_m

weight of Cartesian magnetic-force loss term

lambda_m_parallel

weight of parallel magnetic-force RMSE (requires lambda_m_perp)

lambda_m_perp

weight of perpendicular magnetic-force RMSE (requires lambda_m_parallel)

lambda_tau

weight of spin-torque loss term

lambda_spin_response

weight of grouped magnetic-response loss term

lambda_q

weight of total-charge loss term for qNEP models

lambda_z

weight of Born-effective-charge loss term for qNEP models

lambda_d

weight of energy-difference loss term, with the combinations in ediff.in

atomic_v

fit atomic or global dipole/polarizability targets

lambda_shear

extra weight of shear-virial loss terms

force_delta

bias term that can be used to make smaller forces more accurate

batch

batch size for training

population

population size used in the SNES algorithm [Schaul2011]

generation

number of generations used by the SNES algorithm [Schaul2011]

seed

random seed for the SNES algorithm

save_potential

periodically save model checkpoints and, optionally, restart checkpoints

output_interval

interval between regular training-status and model/test-set outputs

output_descriptor

output normalized descriptors in prediction mode

fine_tune

fine tune a model starting from a foundation model

import_q_scaler

import descriptor normalization factors from an existing nep.txt

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.