Evaluating a Trained Model#
After training, use enerzyme predict to run inference on a test set and report metrics. The reference config is enerzyme/config/predict.yaml.
Basic command#
enerzyme predict -c predict.yaml -o results/ -m model_dir/ -mc train.yaml
Arguments:
-c/--config_path— prediction config (testDatahub, optionalMetric)-m/--model_dir— directory containing trained checkpoints (fromenerzyme train -o)-mc/--model_config_path— training config used to build the model (defaults tomodel_dir/config.yamlif omitted)-o/--output_dir— where CSV summaries and per-model pickles are written
Configuration#
Prediction YAML overrides the training Datahub for an external test set while keeping transforms and neighbor-list settings consistent with training.
Datahub:
data_path: "test.pkl"
data_format: pickle
features:
Ra: coord
Za: atom_type
Q:
N:
preload: true
targets:
E: energy
Fa: grad
Qa: chrg
M2: dipole
Metric:
E:
rmse: 1
Fa:
rmse: 52.917721
Trainer:
non_target_features:
- E_var
- Qa_var
Key points:
data_path— external test set; if omitted, data comes from the training configMetric— overrides per-model metrics from training for this evaluationnon_target_features— extra outputs saved to prediction pickles (e.g. committee uncertaintyE_var,Qa_varwhen using shallow ensembles)
Simple prediction mode#
For inference only (no metric reporting), pass --simple_predict:
enerzyme predict -c predict.yaml -o results/ -m model_dir/ -mc train.yaml -s
Outputs#
Enerzyme loads all active models from the model config, runs prediction, and writes:
Per-model prediction pickles under each model subfolder in
output_dirA summary CSV in
output_dirwith aggregated metrics whenMetricis defined
Note
Uncertainty fields require a committee-trained model or another UQ-capable setup. See Active Learning for Neural Network Potentials.
Next steps#
Run constrained optimization or MD: Running Simulations with a Trained Model
Rank uncertain structures for relabeling: Extracting Fragments by Local Uncertainty