Skip to content

stb-mlffValidate

Stage 3 - Validate of the 7.1 Custom ML Force Field (MACE fine-tuning) workflow · menu code 7.1.3

usage: stb-mlffValidate [-h] [--workflow JSON] [--rounds K [K ...]] [--detail-round K]
                        [--model PATH [PATH ...]] [--test-path GLOB]
                        [--phonon-ref DIR] [--phonon-mesh NA NB NC]
                        [--target-force MEV_ANG] [--plateau PCT]
                        [--foundation-model {small,medium,large}]
                        [--skip-foundation-comparison] [--device {cpu,cuda}]
                        [--png FILE] [--show] [--save-data] [--view-worst N]
                        [--compare A B] [--md-check] [--md-check-temperature K]
                        [--md-check-steps MD_CHECK_STEPS]
                        [--md-check-frames MD_CHECK_FRAMES]
                        [--md-check-supercell NA NB NC] [--md-check-to-train]
                        [--no-intro] [-v]

Stage 3 (Validate) of the Custom ML Force Field workflow: scores every training round recorded in mlff_workflow.json (its committee mean and each member) against the held-out SIESTA test set from stb-mlff --n-test -- energy, force and stress errors, overall, per kind and per config, with a bootstrap error bar --, compares the test set with the training data (level of theory, range covered), checks whether the committee's disagreement tracks the real error, optionally compares phonons against a finished stb-phononsCreate run, and says whether another active-learning round is worth it. Every warning goes to one final section. Reads finished calculations only -- except --md-check, which writes SIESTA folders of MD frames to score on the next run.

options:
  -h, --help            show this help message and exit
  --workflow JSON       Workflow state file (default: mlff_runs/mlff_workflow.json, or ./mlff_workflow.json inside that folder). Rounds and test set are read from it; each round's metrics are stored back.
  --rounds K [K ...]    Rounds to score (default: all rounds in --workflow).
  --detail-round K      Round shown per kind, per config and per member, and in the figure (default: the latest scored round).
  --model PATH [PATH ...]
                        Score these model files as one committee instead of the workflow's rounds (nothing is stored back).
  --test-path GLOB      Test config folders (default: the test set in --workflow, else 'mlff_test/test_*'). Quote the pattern.
  --phonon-ref DIR      A finished stb-phononsCreate folder (phonopy_disp.yaml + disp-*/ with SIESTA forces): the committee-mean model is run on the SAME displacements and its frequencies compared q-point by q-point.
  --phonon-mesh NA NB NC
                        q-point mesh for --phonon-ref (default: 8 8 8, with 1 along every vacuum axis of the reference cell -- 8 8 1 for a slab or a 2D material).
  --target-force MEV_ANG
                        Test F RMSE (meV/Ang) that is good enough for the intended use: the verdict says stop once the latest round reaches it.
  --plateau PCT         A round that lowers the test F RMSE by less than this, in %, is reported as a plateau (default: 5).
  --foundation-model {small,medium,large}
                        Foundation model for the baseline row (default: the one the latest round was trained from, else medium).
  --skip-foundation-comparison
                        Do not score the raw foundation model on the test set.
  --device {cpu,cuda}   Device to run the models on (default: cpu).
  --png FILE            Summary figure (default: mlff_validation.png, next to --workflow).
  --show                Also display the summary figure on screen (it is always saved).
  --save-data           Also write mlff_validation_errors.dat (next to --workflow): per test config of the detailed round, its kind, SIESTA max force, model and foundation F RMSE, energy error, committee spread, novelty. Off by default.
  --view-worst N        Write the N worst-predicted test configs to mlff_test_worst.xyz (per-atom force error as 'F_error' and as the initial charge, so ASE's viewer can color by it: View > Colors > By initial charge) and open them. Default: 0.
  --compare A B         Compare two rounds config by config (which test configs got better or worse from round A to round B, per kind too). Both are scored even if --rounds leaves them out.
  --md-check            Run an NVT MD with the best round's model and write evenly spaced frames as SIESTA single-point folders in <run folder>/md_check/ (recorded in the workflow file as their own set, not the test set). Run SIESTA in them; every later stb-mlffValidate then reports the error along the trajectory -- the test closest to real use. The one option that writes folders.
  --md-check-temperature K
                        MD check temperature (default: 300 K).
  --md-check-steps MD_CHECK_STEPS
                        MD check length in 1 fs steps (default: 2000).
  --md-check-frames MD_CHECK_FRAMES
                        Frames written for SIESTA, evenly spaced (default: 8).
  --md-check-supercell NA NB NC
                        Run the MD check in this supercell of the reference (default: 1 1 1); the k-grid is divided accordingly, as in stb-mlffActiveLearning --supercell.
  --md-check-to-train   Move the finished MD-check frames into the training set (they are already SIESTA-labeled): the next stb-mlffAnalysis trains on them.
  --no-intro            Do not show the introduction
  -v, --version         show program's version number and exit

Example usage:
  stb-mlffValidate                         # every round in mlff_workflow.json
  stb-mlffValidate --show --save-data      # display the figure, write per-config errors
  stb-mlffValidate --target-force 30 --phonon-ref phonon_runs
  stb-mlffValidate --view-worst 3          # worst test configs in ASE's viewer
  stb-mlffValidate --model a.model b.model --test-path 'mlff_test/test_*'