The package replicates the training and testing of GLCNN model using carbon-based transition metal single-atom catalysts (TMSACs) or user-defined datasets.
This package requires:
- tensorflow
- scikit-learn
- pymatgen
- networkx
- pickle
- matplotlib
The easiest way of installing the prerequisites is via conda.
After installing conda, run the following command to create a new environment named GLCNN
and install all prerequisites:
conda upgrade conda
conda create --name GLCNN python=3.8 -c conda-forgeThis creates a conda environment for running GLCNN.
Before using GLCNN, activate the environment by:
source activate GLCNNAfter activating the environment, tensorflow 2.6 for GPU is needed:
conda install tensorflow-gpu=2.6 cudatoolkit=11.3 cudnn=8.2The above three versions should be compatible with each other.
If GPU is not available, use CPU-version tensorflow instead:
pip install tensorflowHowever, the training of GLCNN is far more efficient when using GPU.
The installation of pymatgen is as following:
conda install --channel conda-froge pymatgenThe other prerequisites installed via pip:
pip install scikit-learn networkx pickle matplotlibThen, in directory GLCNN, you can test GLCNN by running:
python graph.py
python pixel.pygraph.py and pixel.py generate descriptor and grid inputs named graphs.pkl and pixels.pkl in data folder.
The user-defined structural files in VASP5.x POSCAR format (element row in file) should be
stored in user_catalysts folder and named appropriately, e.g., POSCAR_1, POSCAR_2.
If the users want to train and test GLCNN using demo structures provided in demo_catalysts folder,
run graph.py and pixel.py as following:
python graph.py --demo
python pixel.py --demoAfter generations of grids and descriptors, train and test GLCNN:
python GLCNN.py --batch=256 --repeat=20 --epoch=200GLCNN.py train and test GLCNN using generated inputs graphs.pkl and pixels.pkl.
--batch, --repeat and --epoch denote batch size, DA iterations and epoch to training respectively.
Using:
python GLCNN.py --helpto get more information.
out_OH.csv will be generated after GLCNN training and test, which containing predicted and true values.
The log of the GLCNN running is recorded in the log folder.
The optimized GLCNN model in the training process is saved in the model_opt folder.
42, 42_2, 24 and 22 folders in demo_catalysts denote different cell expansion coefficients.
The distribution of N outside defects in 42_2 is different from that in 42.
The structure of the 42 folder is as following:
GLCNN
├─ 42 # cell expansion coefficient
│ ├─ 0N # N content outside defect
│ │ ├─ SV # defect containing 0 N
│ │ │ ├─ Sc # TM atom
│ │ │ │ POSCAR
│ │ │ │ POTCAR
│ │ │ ├─ Ti
│ │ │ │ POSCAR
│ │ │ │ POTCAR
│ │ │ ├─ ...
│ │ ├─ SV_1N # defect containing 1 N
│ │ │ ├─ Sc
│ │ │ │ POSCAR
│ │ │ │ POTCAR
│ │ │ ├─ ...
22, 24 and 42_2 folders also have the same structure as 42.