The pytorch implement of papar AI-accelerated Discovery of Altermagnetic Materials
package required:
- pytorch
- accelerate
- pymatgen
- PyYAML
- tensorboard
- tqdm
- pandas
- run files in the
preprocess
directory, move the output files oflabel0.csv
andcandidate.csv
toroot_dir
directory - check required data files in
root_dir
atom_init.json
: a JSON file that stores the initialization vector for each element.label0.csv
: a CSV file that stores theID
for the non-altermagnetic crystallabel1.csv
: a CSV file that stores theID
for the altermagnetic crystalcandidate.csv
: a CSV file that stores theID
for the crystal in candidate datasets
- run
download.py
to downloadCIF
files of all crystals in the three CSV files from Materials Project. Download time depends on your internet speed. Once completed, the structure underroot_dir
will be
root_dir
├── atom_init.json
├── label0.csv
├── label1.csv
├── candidate.csv
├── id_prop_0.csv
├── id_prop_1.csv
├── id_prop_-1.csv
├── id0.cif
├── id1.cif
├── ...
- set the configuration of accelerate in a proper path, for example
accelerate config --config_file yamls/accelerate.yaml
- check and update yamls/pretrain.yaml, then run
pretrain.py
nohup sh pretrain.sh &
or
accelerate launch --config_file yamls/accelerate.yaml pretrain.py --file yamls/pretrain.yaml
- check and update yamls/train.yaml, then run
train.py
nohup sh train.sh &
or
accelerate launch --config_file yamls/accelerate.yaml train.py --file yamls/train.yaml
- check and update yamls/predict.yaml, then run
predict.py
python predict.py --file yamls/predict.yaml
You can also directly load our trained model without pre-training and training yourself. Our weights of classifier model can be download from Google Drive.