Single-Output Regression¶
Train a model that predicts a single scalar property (formation energy, bandgap, bulk modulus, …).
Command¶
train_alignn.py \
--root_dir "alignn/examples/sample_data" \
--config "alignn/examples/sample_data/config_example.json" \
--output_dir=temp
What you need¶
- A dataset directory with structures and
id_prop.csv— see Dataset Format. - A config JSON, e.g.
config_example.json.
The bundled sample_data trains OPT-bandgap on 50 JARVIS-DFT materials. The data was
generated by
generate_sample_data_reg.py —
adapt it to build a larger dataset or use your own structures.
Output¶
After training finishes, --output_dir contains:
best_model.pt— the model checkpoint with the lowest validation losshistory_train.json,history_val.json— per-epoch metricsprediction_results_test_set.csv— predictions on the held-out test set
CLI reference¶
Tips¶
- Use
batch_size: 32or64in the config for real trainings. - If you need to train on one set and evaluate on another, set
n_train,n_val,n_testandkeep_data_order: true. - For datasets hosted by
jarvis-tools, thealignn/scripts/directory has ready-to-run scripts that download and train in one step.
See also¶
- Classification — same workflow with a threshold
- Multi-output regression — multiple targets at once
- Colab: 2D exfoliation energy
- Colab: superconductor Tc