Schema for Concurrent Learning Configuration¤
The schema to configure the input file for concurrent learning process.
Example config 1:¤
### Example configuration file for Concurrent Learning with clff
#####ANCHOR Training
train:
init_data_paths:
- ../1_gendata/*/*/02_gendata/data_label.extxyz
- ../1_gendata/1_iteration_data
preprocess_data:
trainset_ratio: 0.9
validset_ratio: 0.1
num_cores: 1 # number of cores for building graph data
# ase_kwargs:
# energy_key: 'ref_energy' # keyword for energy in ASE extxyz file. Default is 'energy'
# force_key: 'ref_forces' # keyword for force in ASE extxyz file. Default is 'forces'
# stress_key: 'ref_stress' # keyword for stress in ASE extxyz file. Default is 'stress'
continue_train: True # continue checkpoints from previous iteration. Default is True
num_grad_updates: 100000 # Maximum number of updates to guess num_epochs. Default is None
distributed:
distributed_backend: 'nccl' # choices: 'mpi' or 'nccl' 'gloo'
cluster_type: 'slurm' # choices: 'slurm' or 'sge'
# gpu_per_node: 1 # only need in sge
num_models: 4
mlp_model: sevenn # 'sevenn_mliap', 'sevenn',
sevenn_args: # Updated: Dec 17, 2024. See: https://github.com/MDIL-SNU/SevenNet/blob/main/example_inputs/training/input_full.yaml
model:
chemical_species: ['Mo', 'W', 'S', 'Se', 'Te'] # Elements model should know. [ 'Univ' | 'Auto' | manual_user_input ]
cutoff: 5.0 # Cutoff radius in Angstroms. If two atoms are within the cutoff, they are connected.
channel: 32 # The multiplicity(channel) of node features.
lmax: 2 # Maximum order of irreducible representations (rotation order).
num_convolution_layer: 4 # The number of message passing layers.
# irreps_manual: # Manually set irreps of the model in each layer (e.g., 128 channels + 5 layers)
#- "128x0e"
#- "128x0e+64x1e+32x2e"
#- "128x0e+64x1e+32x2e"
#- "128x0e+64x1e+32x2e"
#- "128x0e+64x1e+32x2e"
#- "128x0e"
weight_nn_hidden_neurons: [64, 64] # Hidden neurons in convolution weight neural network
radial_basis: # Function and its parameters to encode radial distance
radial_basis_name: 'bessel' # Only 'bessel' is currently supported
bessel_basis_num: 8
cutoff_function: # Envelop function, multiplied to radial_basis functions to init edge featrues
cutoff_function_name: 'poly_cut' # {'poly_cut' and 'poly_cut_p_value'} or {'XPLOR' and 'cutoff_on'}
poly_cut_p_value: 6
act_gate: {'e': 'silu', 'o': 'tanh'} # Equivalent to 'nonlinearity_gates' in nequip
act_scalar: {'e': 'silu', 'o': 'tanh'} # Equivalent to 'nonlinearity_scalars' in nequip
is_parity: False # Pairy True (E(3) group) or False (to SE(3) group)
self_connection_type: linear # Default is 'nequip'. 'linear' is used for SevenNet-0.
interaction_type: nequip
conv_denominator: "avg_num_neigh" # Valid options are "avg_num_neigh*", "sqrt_avg_num_neigh", or float
train_denominator: False # Enable training for denominator in convolution layer
train_shift_scale: False # Enable training for shift & scale in output layer
train:
random_seed: 1
train_shuffle: True
is_train_stress: True # Includes stress in the loss function
epoch: 3 # Ends training after this number of epochs
per_epoch: 20 # Generate checkpoints every this epoch
# loss: 'Huber' # Default is 'mse' (mean squared error)
# loss_param:
# delta: 0.01
# Each optimizer and scheduler have different available parameters.
# You can refer to sevenn/train/optim.py for supporting optimizer & schedulers
optimizer: 'adam' # Options available are 'sgd', 'adagrad', 'adam', 'adamw', 'radam'
optim_param:
lr: 5.0e-4
scheduler: linearlr
scheduler_param:
start_factor: 1.0
total_iters: 3 # {..epoch}
end_factor: 1.0e-7
# scheduler: 'reducelronplateau' # One of 'steplr', 'multisteplr', 'exponentiallr', 'cosineannealinglr', 'reducelronplateau', 'linearlr'
# scheduler_param:
# factor: 0.75
# patience: 2
# threshold: 5.0e-5 # only changes large than this value will be considered as a change
# min_lr: 1.0e-12 # minimum learning rate
# scheduler: exponentiallr
# scheduler_param:
# gamma: 0.95 # large gamma means slower decay
force_loss_weight: 1.0 # Coefficient for force loss
stress_loss_weight: 1.0e-4 # Coefficient for stress loss (to kbar unit), kbar = 0.1 GPa
# ['target y', 'metric']
# Target y: TotalEnergy, Energy, Force, Stress, Stress_GPa, TotalLoss
# Metric : RMSE, MAE, or Loss
error_record:
- ['Energy', 'RMSE']
- ['Force', 'RMSE']
- ['Stress', 'RMSE']
# - ['Stress_GPa', 'RMSE']
- ['Energy', 'Loss']
- ['Force', 'Loss']
- ['Stress', 'Loss']
- ['TotalLoss', 'None']
best_metric: TotalLoss
### THANG: do not use this, just set `init_checkpoints` above
# Continue training model from given checkpoint, or pre-trained model checkpoint for fine-tuning
#continue:
#checkpoint: 'checkpoint_best.pth' # Checkpoint of pre-trained model or a model want to continue training.
#reset_optimizer: False # Set True for fine-tuning
#reset_scheduler: False # Set True for fine-tuning
data:
batch_size: 280 # Per GPU batch size.
shift: 'per_atom_energy_mean' # One of 'per_atom_energy_mean*', 'elemwise_reference_energies', float
scale: 'force_rms' # One of 'force_rms*', 'per_atom_energy_std', 'elemwise_force_rms', float
#####ANCHOR Run MD
md:
committee_std:
e_std_lo: 0.05
e_std_hi: 0.15
f_std_lo: 0.05
f_std_hi: 0.15
s_std_lo: 0.05
s_std_hi: 0.15
checkpoint_conversion:
checkpoint_idx: 2 # index of models used for MD
dftd3: # add DFT-D3 correction during MD simulation
damping: 'zero' # damping method. Choices: "damp_zero", "damp_bj". Default is "damp_zero"
xc: 'pbe' # exchange-correlation functional. Default is "pbe"
md_calculator: 'lammps' # 'lammps', 'ase'
common_md_args:
dt: 0.001 # unit ASE: 1 fs; LAMMPS: 0.001 ps
thermostat: 'nose_hoover_chain' # 'langevin', 'nose_hoover_chain'. Nose-Hoover chain only for LAMMPS.
barostat: 'nose_hoover_chain' # ASE:'parrinello_rahman'. LAMMPS: 'nose_hoover_chain'
tdamp: 100
pdamp: 1000
init_struct_paths:
### MoX2 & WX2 bulk
- 0init_struct/bulk_MoX2_2x2x1/MoS2_mx2_2H_02x02x01 # '0-5'
- 0init_struct/bulk_MoX2_2x2x1/MoS2_mx2_1T_02x02x01
- 0init_struct/bulk_MoX2_2x2x1/MoSe2_mx2_2H_02x02x01
- 0init_struct/bulk_MoX2_2x2x1/MoSe2_mx2_1T_02x02x01
- 0init_struct/bulk_MoX2_2x2x1/MoTe2_mx2_2H_02x02x01
- 0init_struct/bulk_MoX2_2x2x1/MoTe2_mx2_1T_02x02x01 # 5
- 0init_struct/bulk_WX2_2x2x1/WS2_mx2_2H_02x02x01 # '6-11'
- 0init_struct/bulk_WX2_2x2x1/WS2_mx2_1T_02x02x01
- 0init_struct/bulk_WX2_2x2x1/WSe2_mx2_2H_02x02x01
- 0init_struct/bulk_WX2_2x2x1/WSe2_mx2_1T_02x02x01
- 0init_struct/bulk_WX2_2x2x1/WTe2_mx2_2H_02x02x01
- 0init_struct/bulk_WX2_2x2x1/WTe2_mx2_1T_02x02x01 # 11
### MoX2 & WX2 layer
- 0init_struct/layer_MoX2_2x2x1/MoS2_mx2_2H_02x02x01 # '24-29'
- 0init_struct/layer_MoX2_2x2x1/MoS2_mx2_1T_02x02x01
- 0init_struct/layer_MoX2_2x2x1/MoSe2_mx2_2H_02x02x01
- 0init_struct/layer_MoX2_2x2x1/MoSe2_mx2_1T_02x02x01
- 0init_struct/layer_MoX2_2x2x1/MoTe2_mx2_2H_02x02x01
- 0init_struct/layer_MoX2_2x2x1/MoTe2_mx2_1T_02x02x01 # 29
- 0init_struct/layer_WX2_2x2x1/WS2_mx2_2H_02x02x01 # '30-35'
- 0init_struct/layer_WX2_2x2x1/WS2_mx2_1T_02x02x01
- 0init_struct/layer_WX2_2x2x1/WSe2_mx2_2H_02x02x01
- 0init_struct/layer_WX2_2x2x1/WSe2_mx2_1T_02x02x01
- 0init_struct/layer_WX2_2x2x1/WTe2_mx2_2H_02x02x01
- 0init_struct/layer_WX2_2x2x1/WTe2_mx2_1T_02x02x01 # 35
sampling_spaces:
### If set both stress and temperature, it will use NPT ensemble.
### If set only temperature, it will use NVT ensemble.
### If none of them, it will use NVE ensemble.
- {}
- {}
### MoX2 & WX2
- init_struct_idxs: ['0-5', '12-17', '24-29', '30-35'] ##TODO BULK & LAYER: NVT
equil_steps: 20000
traj_freq: 5
num_frames: 20
temps: [100, 300, 600, 900, 1000] # temperatures in K
- init_struct_idxs: ['0-5', '12-17', '24-29', '30-35'] ##TODO BULK & LAYER: NPT xy
equil_steps: 20000
traj_freq: 5
num_frames: 20
temps: [100, 300, 600, 900, 1000] # temperatures in K
pressures: [0, 1] # stresses in GPa
mask: [1,1,0] # disable z-direction barostat
- init_struct_idxs: ['0-5','6-11','12-17','18-23'] ##TODO BULK: NPT xyz
equil_steps: 20000
traj_freq: 5
num_frames: 20
temps: [100, 300, 600, 900, 1000]
pressures: [0, 1] # stresses in GPa
mask: [1,1,1]
deform_limit: 0.9
#####ANCHOR DFT calculation
dft:
calc_args:
gpaw: ### accept GPAW parameters
mode:
name: 'pw' # use PlaneWave method energy cutoff in eV
ecut: 500
xc: "PBE" # exchange-correlation functional
kpts:
density: 6
gamma: False # if not set `kpts`, then only Gamma-point is used
parallel:
sl_auto: True # enable ScaLAPACK parallelization
use_elpa: True # enable Elpa eigensolver
# augment_grids: True # use all cores for XC/Poisson solver
# gpu: True # enable GPU acceleration
dftd3: ### DFT-D3 method for Van der Waals correction
damping: "d3zero" # use DFT-D3 damping. Default is "d3zero" (zero-damping). Choices: "d3bj","d3zero","d3bjm","d3zerom","d3op".