DeePKS-Training-Demo
©️ Copyright 2023 @ Authors
Author:
Qi Ou 📨
Date: 2023-08-23
Quick start: click on the Connect button located at the top of the interface, then select the abacus:3.1.4-toolkit-notebook-oss2 Image and choose c2_m4_cpu to proceed.
Goal
The goal of this notebook is to show a demo of the DeePKS iterative traning procedure. Single water molecule is applied as the test system, and the DeePKS model based on LDA functional is trained to achieve the accurace of PBE functional.
Catalogue
Background
The DeePKS model is trained based on an iterative training procedure that incorperates the self-consistent field (SCF) calculation performed in an ab initio software and the fitting process by the neural network performed in DeePKS-kit. For periodic systems, the corresponding SCF calculaiton with the DeePKS model is implemented in an open-source DFT package ABACUS.
/data/water_single_lda2pbe_abacus
This directory contains two subdirectories, i.e. systems
and iter
. systems
contains the atomic coordinates (atom.npy
), energy labels (energy.npy
), and force labels (force.npy
) of each water molecule configuration:
systems ├── group.00 │ ├── atom.npy │ ├── energy.npy │ └── force.npy ├── group.01 │ ├── atom.npy │ ├── energy.npy │ └── force.npy ├── group.02 │ ├── atom.npy │ ├── energy.npy │ └── force.npy └── group.03 ├── atom.npy ├── energy.npy └── force.npy 4 directories, 12 files
The number of configurations in group.00
, group.01
, group.02
is 300, while that in group.03
is 100. The first three groups are set as training set, while the last one is set as test set.
iter
is the main working directory that includes all required numerical atomic orbitals, pseudopotentials, projector files, and input parameter files for the DeePKS training:
iter ├── H_ONCV_PBE-1.0.upf ├── H_gga_6au_60Ry_2s1p.orb ├── O_ONCV_PBE-1.0.upf ├── O_gga_6au_60Ry_2s2p1d.orb ├── jle.orb ├── machines.yaml ├── machines_dpdispatcher.yaml ├── params.yaml ├── run.sh ├── run_dpdispatcher.sh ├── scf_abacus.yaml └── systems.yaml 0 directories, 12 files
/data/water_single_lda2pbe_abacus/iter
and we need to fill out the Bohrium account information in machines_dpdispatcher.yaml
:
To trigger the training process, simply issue:
The error message (if any) will be collected in err.iter
:
Analyzing the result
The training procedure will run iteratively, and results of the first iteration will be collected in iter.init
, which corresponds to the so-called DeePHF
training. For each iteration, the SCF calculation results are included in 00.scf
under iter.xx
, and the training results are included in 01.train
under iter.xx
. To check the results of DeePHF
iter.init/01.train ├── 03a64652bceef7e5b17d2f837ab01b499a284c71.sub ├── 03a64652bceef7e5b17d2f837ab01b499a284c71_flag_if_job_task_fail ├── 03a64652bceef7e5b17d2f837ab01b499a284c71_job_tag_finished ├── STDOUTERR ├── backup │ ├── 03a64652bceef7e5b17d2f837ab01b499a284c71.zip │ └── 03a64652bceef7e5b17d2f837ab01b499a284c71_back.zip ├── d87afba9fc01b802763ef2b580fdcd7d37b59093_task_tag_finished ├── data_test -> ../00.scf/data_test ├── data_train -> ../00.scf/data_train ├── err ├── err.train ├── lbg-415-8485888.sh ├── log.test ├── log.train ├── model.pth ├── test.out └── train_input.yaml -> ../../share/init_train.yaml 3 directories, 15 files
The learning curve and training errors are stored at log.train
and log.test
, respectively.