Skip to content

Forked repo from zfgao66/MatAltMag

Notifications You must be signed in to change notification settings

vbo12345/MatAltMag

 
 

Repository files navigation

MatAltMag

The pytorch implement of papar AI-accelerated Discovery of Altermagnetic Materials

Prerequisites

package required:

  • pytorch
  • accelerate
  • pymatgen
  • PyYAML
  • tensorboard
  • tqdm
  • pandas

Run

  1. run files in the preprocess directory, move the output files of label0.csv and candidate.csv to root_dir directory
  2. 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 the ID for the non-altermagnetic crystal
  • label1.csv: a CSV file that stores the ID for the altermagnetic crystal
  • candidate.csv: a CSV file that stores the ID for the crystal in candidate datasets
  1. run download.py to download CIF files of all crystals in the three CSV files from Materials Project. Download time depends on your internet speed. Once completed, the structure under root_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
├── ...
  1. set the configuration of accelerate in a proper path, for example
accelerate config --config_file yamls/accelerate.yaml
  1. 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 
  1. 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
  1. 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.

About

Forked repo from zfgao66/MatAltMag

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 66.2%
  • Jupyter Notebook 33.6%
  • Shell 0.2%