MatPL Parameters
This section describes user-configurable parameters for all models. Basic parameters must be supplied, while advanced parameters have defaults that can be overridden in JSON. A relative path is resolved from the current working directory; an absolute path begins at the filesystem root.
Basic Parameters
model_type
Selects the model type: LINEAR, NN, DP, or NEP.
atom_type
Sets the elements in any chosen order using atomic numbers or symbols. Examples: [29] or ["Cu"] for copper, and [1,6] or ["H","C"] for CH4.
train_data
Specifies training-data paths, either relative or absolute.
- DP and NEP support
extxyz,pwmlff/npy,deepmd/npy,deepmd/raw,pwmat/movement,vasp/outcar, andcp2k/md. - LINEAR and NN support only
pwmat/movement.
valid_data
Specifies validation-data paths, either relative or absolute.
- DP and NEP support
extxyz,pwmlff/npy,deepmd/npy,deepmd/raw,pwmat/movement,vasp/outcar, andcp2k/md. - LINEAR and NN support only
pwmat/movement.
test_data
Specifies test-data paths for the test command, either relative or absolute.
- DP and NEP support
extxyz,pwmlff/npy,deepmd/npy,deepmd/raw,pwmat/movement,vasp/outcar, andcp2k/md. - LINEAR and NN support only
pwmat/movement.
format
Sets the format of train_data, valid_data, and test_data. Supported values include extxyz, pwmlff/npy, deepmd/npy, deepmd/raw, and direct trajectory formats pwmat/movement, vasp/outcar, and cp2k/md. The default is pwmat/movement. See pwdata.
All input datasets must use the same format.
model_load_file
- For fine-tuning or continued training, specifies an initial
.ckptmodel. - For
test, specifies the model path, either relative or absolute.
nep_txt_file
- For fine-tuning or continued training, specifies a
.txtmodel such as GPUMDnep4.txtornep5.txt. - The text file may be a universal force field covering 89 elements. MatPL extracts parameters for the elements in
atom_type, enabling fine-tuning to a smaller model. This can be combined withfix_cij,fix_hiddenlayer, andfix_outlayerundermodel->fitting_net.
recover_train
Whether to resume an interrupted training task. The default is true.
reserve_work_dir
For LINEAR and NN, whether to retain work_dir after execution. The default is false.
save_step
Sets the model-save interval in iterations. The default is None, so models are saved only after each epoch.
max_save_num
With save_step, sets the maximum number of recent models retained. The default is 10.
NEP Model Hyperparameters
The complete NEP model configuration is:
"model": {
"descriptor": {
"cutoff": [6.0,6.0],
"n_max": [4,4],
"basis_size": [12,12],
"l_max": [4,2,1],
"zbl": 2.0
},
"fitting_net": {
"network_size": 40,
"fix_cij":false,
"fix_hiddenlayer":false,
"fix_outlayer":false
}
}
cutoff
Sets radial and angular cutoff radii. The default is [8.0, 4.0].
n_max
Sets n_max for radial and angular descriptors. Each value must be between 0 and 19. The default is [4,4].
basis_size
Sets the radial and angular basis sizes. Each value must be between 0 and 19. The default is [8,8].
l_max
Sets angular expansion orders and enables four- and five-body descriptors. The default [4,2,1] contains the three-, four-, and five-body orders. Use [4,0,0] for three-body only or [4,2,0] for three- and four-body descriptors.
The numbers of two-, three-, four-, and five-body descriptors are n_max[0]+1, (n_max[1]+1)*l_max[0], n_max[1]+1, and n_max[1]+1, respectively.
network_size
Sets the number of neurons in NEP's single hidden layer. The default is 40.
zbl
Sets the outer cutoff of the Ziegler–Biersack–Littmark (ZBL) potential (DOI: 10.1007/978-1-4615-8103-1_3); the inner cutoff is fixed at half the outer cutoff. It is disabled by default. A value in is recommended.
use_typewise_cutoff_zbl
Enables type-wise ZBL cutoffs. The outer cutoff for a pair is min(zbl, use_typewise_cutoff_zbl × sum of covalent radii), and the inner cutoff is fixed at 0.0. Disabled by default; introduced in MatPL-2026.3 Update 1.
fix_cij
Fine-tuning option that freezes NEP two- and three-body feature coefficients. The default is false.
fix_hiddenlayer
Fine-tuning option that freezes NEP hidden-layer parameters W0 and B0. The default is false.
fix_outlayer
Fine-tuning option that freezes NEP output-layer parameters W1 and B1. The default is false.
Interpreting NEP.txt
A standard NEP.txt header is shown below.
nep5 2 O Hf # Number of element types, followed by their symbols
zbl 1 2 # Present only when ZBL is enabled during training
cutoff 6.0 6.0 108 108 # Two-body cutoff, many-body cutoff, and their maximum neighbor counts
n_max 4 4 # Two-body and many-body n_max
basis_size 12 12 # Two-body and many-body basis_size
l_max 4 2 1 # Three-, four-, and five-body l_max values
ANN 40 0 # 40 hidden neurons; 0 is a placeholder
The remaining lines contain four blocks: network parameters, two-body coefficients, three-body coefficients, and normalization values.
-
Block 1 contains network parameters for . Its size is
number of elements × (number of features × ANN[0] + ANN[0] + ANN[0]) + number of elements. For each element in header order, it storesW0,B0, andW1, followed by oneb1per element. A GPUMD-trained NEP4 file stores only oneb1, the mean across elements.W0is flattened row-major from[ANN hidden units, number of features]. -
Block 2 contains two-body coefficients:
number of elements² × (n_max[0]+1) × (basis_size[0]+1). -
Block 3 contains three-body coefficients:
number of elements² × (n_max[1]+1) × (basis_size[1]+1).In either coefficient block, the matrix order is
[I,J,N,K]:Iis the central element,Jis the neighbor element, both following header order;N=n_max+1; andK=basis_size+1. -
Block 4 contains one normalization value per feature, ordered by two-, three-, four-, and five-body terms. Their counts are
n_max[0]+1,(n_max[1]+1)*l_max[0],n_max[1]+1, andn_max[1]+1.
DP Model Hyperparameters
The complete DP model configuration is:
"type_embedding":false,
"model": {
"type_embedding":{
"physical_property":["atomic_number", "atom_mass", "atom_radius", "molar_vol", "melting_point", "boiling_point", "electron_affin", "pauling"]
},
"descriptor": {
"Rmax": 6.0,
"Rmin": 0.5,
"M2": 16,
"network_size": [25,25,25]
},
"fitting_net": {
"network_size": [50,50,50,1]
}
}
type_embedding
Configures type embedding for DP training. You may also set "type_embedding":true alongside model, which uses ["atomic_number","atom_radius","atom_mass","electron_affin","pauling"]. The default is false.
physical_property
Selects physical properties for DP type embedding. Eight properties are available:
atomic_number: atomic numberatom_mass: atomic massatom_radius: atomic radiusmolar_vol: molar volumemelting_point: melting pointboiling_point: boiling pointelectron_affin: electron affinitypauling: Pauling electronegativity
The default physical_property is ["atomic_number","atom_radius","atom_mass","electron_affin","pauling"].
Rmax
Maximum cutoff radius of the DP smoothing function. The default is .
Rmin
Minimum cutoff radius of the DP smoothing function. The default is .
M2
Sets the DP embedding-network output dimension and therefore the fitting-network input dimension. In the example, these are 25 × 16 and 25 × 16 = 400. The default is 16.
network_size
Sets the embedding- and fitting-network structures. Defaults are [25,25,25] and [50,50,50,1].
Embedding network: Input -> hidden layer 1 (25 neurons) -> hidden layer 2 (25 neurons) -> output layer (25 neurons)
Fitting network:
Input (M2 × 25) -> three hidden layers (50 neurons each) -> output (1 neuron)
NN Model Hyperparameters
The complete NN model configuration is:
"model": {
"descriptor": {
"Rmax": 6.0,
"Rmin": 0.5,
"feature_type": [3,4]
},
"fitting_net": {
"network_size": [15,15,1]
}
}
Rmax
Maximum feature cutoff radius. The default is .
Rmin
Minimum feature cutoff radius. The default is .
feature_type
Selects feature types. Supported values are [1,2], [3,4], [5], [6], [7], and [8]. The default [3,4] selects two- and three-body Gaussian features. See Appendix 1.
network_size
Sets the fitting-network structure. The default [15,15,1] gives:
Input -> hidden layer 1 (15 neurons) -> hidden layer 2 (15 neurons) -> output (1 neuron)
Linear Model Hyperparameters
The complete Linear model configuration is:
"model": {
"descriptor": {
"Rmax": 6.0,
"Rmin": 0.5,
"feature_type": [3,4]
}
}
Rmax
Maximum feature cutoff radius. The default is .
Rmin
Minimum feature cutoff radius. The default is .
feature_type
Selects feature types using the same settings as the NN model. Supported values are [1,2], [3,4], [5], [6], [7], and [8]. The default [3,4] selects two- and three-body Gaussian features. See Appendix 1.
ADAM Optimizer Hyperparameters
The complete ADAM configuration is:
"optimizer": {
"optimizer": "ADAM",
"epochs": 30,
"reset_epoch":false,
"batch_size": 1,
"print_freq": 10,
"lambda_2" : 0.1,
"learning_rate": 0.001,
"stop_lr": 3.51e-08,
"stop_step": 1000000,
"decay_step": 5000,
"max_norm": 0.5,
"norm_type": 2,
"t_0": 6,
"t_mult": 1,
"train_energy": true,
"train_force": true,
"train_virial": false,
"start_pre_fac_force": 1000,
"start_pre_fac_etot": 0.02,
"start_pre_fac_virial": 50.0,
"end_pre_fac_force": 1.0,
"end_pre_fac_etot": 1.0,
"end_pre_fac_virial": 1.0
}
optimizer
Selects the optimizer. The default is ADAM; use LKF for the LKF optimizer. See the LKF paper.
reset_epoch
Whether restarted training begins at epoch 0. The default is true. Set false to resume from a checkpoint and restore ADAM's first- and second-moment states.
epochs
Sets the number of epochs. Each epoch processes the entire dataset in mini-batches with forward propagation, loss calculation, and backpropagation. The default is 30.
Choose the epoch count by monitoring training and validation. Too few epochs may underfit; too many may overfit and reduce generalization.
batch_size
Sets the number of samples in each mini-batch. The default is 1.
print_freq
Sets the number of mini-batch iterations between training-error reports. The default is 10.
train_energy
Whether to train on total energy. The default is true.
train_force
Whether to train on forces. The default is true.
train_virial
Whether to train on virials. The default is false.
lambda_2
Sets ADAM L2 regularization. It is disabled by default and may reduce overfitting.
learning_rate
Initial ADAM learning rate. The default is 0.001.
stop_lr
Minimum learning rate. Once reached, it remains fixed. The default is 3.51e-08.
stop_step
Step at which learning-rate decay stops and the rate equals stop_lr. The default is 1000000.
decay_step
Learning-rate decay interval. The default is 5000 steps.
learning_rate, stop_lr, stop_step, and decay_step determine the schedule as follows:
decay_rate = np.exp(np.log(stop_lr/learning_rate) / (stop_step/decay_step))
real_lr = learning_rate * np.power(decay_rate, (iter_num//decay_step))
First calculate decay_rate:
Then update the learning rate:
where iter_num is the training iteration.
Energy and Force Prefactors in the Loss
Force, energy, and virial prefactors:
-
start_pre_fac_force: force-loss prefactor at the start of training. Must be nonnegative; default100. -
end_pre_fac_force: force-loss prefactor at the end of training. Default1.0. -
start_pre_fac_etot: total-energy prefactor at the start of training. Default1.0. -
end_pre_fac_etot: total-energy prefactor at the end of training. Default1.0. -
start_pre_fac_virial: virial prefactor at the start of training. Default0.1. -
end_pre_fac_virial: virial prefactor at the end of training. Default0.1.
Loss-prefactor calculation:
During ADAM training, each loss prefactor depends on the current real_lr:
lr_ratio = real_lr / learning_rate
lr_ratio = min(max(lr_ratio, 0.0), 1.0)
prefactor = end_prefactor + (start_prefactor - end_prefactor) * lr_ratio
Equivalently:
where x may be force, etot, or virial.
At the start of training:
Therefore: