This codebase introduces an active learning algorithm to dynamically compose a training set during training of a neural network potential (NNP) to prevent over-learning of a specific region of chemical space. The scheme facilitates the further use of data generated from computational studies, which tend to unevenly cover regions of chemical space and are not well-suited to use directly as training sets for NNPs.
Our active learning scheme is applied to the well-known SchNet NNP, with a specific focus on shear processes in materials systems containing several hundred atoms. To accomodate such large systems, several algorithmic enhancements were required, as detailed in the SchNetPack Expansion Features section.
We also demonstrate the use of the actively trained NNP to examine vacancy migration under shear in mixed metal systems. Code is provided for the implementation of the NNP into the ASE structure optimization module for geometry relaxation, along with the algorithm to simulate shear. We also provide code for the analysis of vacancy position based on GALAS and the generation and analysis of multiple evolutionary pathways the material can experience under shear.
- python 3
- ASE
- numpy
- PyTorch (>=2.5.2)
- h5py
- networkx
- Optional: tensorboardX
Note: We recommend using a GPU for training neural network potentials.
- Active learning scheme to dynamically compose the training set during training
- Automatic Mixed Precision (AMP) for faster and more memory efficient training on NVIDIA GPUs
- Nearest neighbor preprocessing for improved computational efficiency
- Neighbor distance computations for systems with periodic boundary conditions using the Minimum Image Convention in Non-Cubic MD Cells to improve speed and reduce memory requirements
All code was tested using python 3.9 and cuda 11.0 on a Linux operating system.
conda create --name active_schnet --file spec-file.txt
conda activate active_schnet
python setup.py install
conda install --strict-channel-priority -c https://conda.ovito.org -c conda-forge ovito
For the original SchNetPack API reference, visit the documentation.
To save time in training, we recommend preprocessing nearest neighbor calculations. Use the parse_db.py file for this:
python ./preprocessing/parse_db.py --data_path [path to .db file] --preprocessing_path [path to preprocessing dir] --cutoff [atomic cutoff distance]
Use the --no_mic flag to toggle off the minimum image convention for peridic boundary conditions. When --no_mic is present, the mimimum image convention will not be used.
Sprueill, H. W., Bilbrey, J. A., Pang, Q., & Sushko, P. V. (2023). Active sampling for neural network potentials: Accelerated simulations of shear-induced deformation in Cu–Ni multilayers. The Journal of Chemical Physics, 158(11). https://doi.org/10.1063/5.0133023