9.3. DPA-ADAPT command line interface#

The dpaad command is a short alias for dpa-adapt and exposes the same subcommands and options.

DPA tools — fine-tune pre-trained DPA models, extract descriptors, cross-validate, predict, evaluate, and prepare data.

usage: dpa-adapt [-h] [--version]
                 {extract-descriptors,fit,cv,predict,evaluate,data} ...

9.3.1. Named Arguments#

--version

show program’s version number and exit

9.3.2. subcommands#

command

Possible choices: extract-descriptors, fit, cv, predict, evaluate, data

9.3.3. Sub-commands#

9.3.3.1. extract-descriptors#

Extract pooled DPA descriptors to .npy

dpa-adapt extract-descriptors [-h] [-v {DEBUG,3,INFO,2,WARNING,1,ERROR,0}]
                              [-l LOG_PATH] --data DATA [DATA ...]
                              --pretrained PRETRAINED
                              [--model-branch MODEL_BRANCH]
                              [--pooling {mean,sum,mean+std,mean+std+max+min}]
                              --output OUTPUT [--no-cache]

9.3.3.1.1. Named Arguments#

-v, --log-level

Possible choices: DEBUG, 3, INFO, 2, WARNING, 1, ERROR, 0

set verbosity level by string or number, 0=ERROR, 1=WARNING, 2=INFO and 3=DEBUG

Default: “INFO”

-l, --log-path

set log file to log messages to disk, if not specified, the logs will only be output to console

--data

System directories.

--pretrained

Path to DPA checkpoint (.pt).

--model-branch
--pooling

Possible choices: mean, sum, mean+std, mean+std+max+min

Default: “mean”

--output

Output .npy path.

--no-cache

Bypass descriptor cache.

Default: False

9.3.3.2. fit#

Train a model (any strategy)

dpa-adapt fit [-h] [-v {DEBUG,3,INFO,2,WARNING,1,ERROR,0}] [-l LOG_PATH]
              --train-data TRAIN_DATA [TRAIN_DATA ...]
              [--valid-data VALID_DATA [VALID_DATA ...]]
              [--pretrained PRETRAINED] [--model-branch MODEL_BRANCH]
              [--strategy {frozen_sklearn,frozen_head,finetune,mft}]
              [--predictor {rf,linear,ridge,mlp}]
              [--pooling {mean,sum,mean+std,mean+std+max+min}]
              [--target-key TARGET_KEY] [--output OUTPUT]
              [--type-map TYPE_MAP] [--task-dim TASK_DIM]
              [--intensive | --no-intensive] [--max-steps MAX_STEPS]
              [--learning-rate LEARNING_RATE] [--stop-lr STOP_LR]
              [--batch-size BATCH_SIZE] [--seed SEED]
              [--output-dir OUTPUT_DIR] [--save-freq SAVE_FREQ]
              [--disp-freq DISP_FREQ] [--aux-data AUX_DATA [AUX_DATA ...]]
              [--aux-branch AUX_BRANCH] [--aux-prob AUX_PROB]
              [--mft-type-map MFT_TYPE_MAP]
              [--downstream-task-type {ener,property}]
              [--aux-batch-size AUX_BATCH_SIZE]
              [--downstream-batch-size DOWNSTREAM_BATCH_SIZE]
              [--fparam-dim FPARAM_DIM]

9.3.3.2.1. Named Arguments#

-v, --log-level

Possible choices: DEBUG, 3, INFO, 2, WARNING, 1, ERROR, 0

set verbosity level by string or number, 0=ERROR, 1=WARNING, 2=INFO and 3=DEBUG

Default: “INFO”

-l, --log-path

set log file to log messages to disk, if not specified, the logs will only be output to console

--train-data

Training system directories.

--valid-data

Validation system directories.

--pretrained

Path to DPA checkpoint (.pt).

Default: “DPA-3.1-3M”

--model-branch
--strategy

Possible choices: frozen_sklearn, frozen_head, finetune, mft

Default: “frozen_sklearn”

--predictor

Possible choices: rf, linear, ridge, mlp

Default: “rf”

--pooling

Possible choices: mean, sum, mean+std, mean+std+max+min

Default: “mean”

--target-key

Label key under set.*/ (e.g. energy, homo, bandgap).

--output

Default: “frozen_model.pth”

--type-map
--task-dim

Default: 1

--intensive, --no-intensive

Default: True

--max-steps

Default: 100000

--learning-rate

Default: 0.001

--stop-lr

Default: 1e-05

--batch-size

Default: auto:512

--seed

Default: 42

--output-dir

Default: “./dpa_output”

--save-freq

Default: 10000

--disp-freq

Default: 1000

--aux-data

(mft) Auxiliary system directories.

--aux-branch

(mft) Aux branch name in checkpoint.

Default: “MP_traj_v024_alldata_mixu”

--aux-prob

(mft) Sampling weight for aux branch.

Default: 0.5

--mft-type-map

(mft) Global (shared) type map for MFT. Must be the union of elements in both aux and downstream datasets. Comma-separated, e.g. ‘H,C,N,O’. Auto-detected from checkpoint if omitted.

--downstream-task-type

Possible choices: ener, property

(mft) Downstream head type.

Default: “property”

--aux-batch-size

(mft) Batch size for aux branch.

--downstream-batch-size

(mft) Batch size for downstream.

--fparam-dim

(frozen_head/finetune/mft) Dimensionality of per-frame condition inputs (fparam). Requires set.*/fparam.npy in training data. Default: 0.

Default: 0

9.3.3.3. cv#

Cross-validate frozen_sklearn baseline

dpa-adapt cv [-h] [-v {DEBUG,3,INFO,2,WARNING,1,ERROR,0}] [-l LOG_PATH] --data
             DATA [DATA ...] [--label-key LABEL_KEY] [--pretrained PRETRAINED]
             [--model-branch MODEL_BRANCH] [--predictor {rf,linear,ridge,mlp}]
             [--pooling {mean,sum,mean+std,mean+std+max+min}] [--cv CV]
             [--group-by GROUP_BY] [--granularity {frame,composition}]
             [--seed SEED]

9.3.3.3.1. Named Arguments#

-v, --log-level

Possible choices: DEBUG, 3, INFO, 2, WARNING, 1, ERROR, 0

set verbosity level by string or number, 0=ERROR, 1=WARNING, 2=INFO and 3=DEBUG

Default: “INFO”

-l, --log-path

set log file to log messages to disk, if not specified, the logs will only be output to console

--data

System directories.

--label-key

Default: “energy”

--pretrained

Path to DPA checkpoint (.pt).

Default: “DPA-3.1-3M”

--model-branch
--predictor

Possible choices: rf, linear, ridge, mlp

Default: “rf”

--pooling

Possible choices: mean, sum, mean+std, mean+std+max+min

Default: “mean”

--cv

Default: “5”

--group-by

Default: “formula”

--granularity

Possible choices: frame, composition

Default: “composition”

--seed

Default: 42

9.3.3.4. predict#

Predict with a frozen .pth bundle

dpa-adapt predict [-h] [-v {DEBUG,3,INFO,2,WARNING,1,ERROR,0}] [-l LOG_PATH]
                  --model MODEL --data DATA [DATA ...] --output OUTPUT

9.3.3.4.1. Named Arguments#

-v, --log-level

Possible choices: DEBUG, 3, INFO, 2, WARNING, 1, ERROR, 0

set verbosity level by string or number, 0=ERROR, 1=WARNING, 2=INFO and 3=DEBUG

Default: “INFO”

-l, --log-path

set log file to log messages to disk, if not specified, the logs will only be output to console

--model

Path to frozen .pth.

--data

System directories.

--output

Output .npy path.

9.3.3.5. evaluate#

Evaluate a frozen .pth against stored labels

dpa-adapt evaluate [-h] [-v {DEBUG,3,INFO,2,WARNING,1,ERROR,0}] [-l LOG_PATH]
                   --model MODEL --data DATA [DATA ...]

9.3.3.5.1. Named Arguments#

-v, --log-level

Possible choices: DEBUG, 3, INFO, 2, WARNING, 1, ERROR, 0

set verbosity level by string or number, 0=ERROR, 1=WARNING, 2=INFO and 3=DEBUG

Default: “INFO”

-l, --log-path

set log file to log messages to disk, if not specified, the logs will only be output to console

--model

Path to frozen .pth.

--data

System directories.

9.3.3.6. data#

Data conversion and validation tools

dpa-adapt data [-h] [-v {DEBUG,3,INFO,2,WARNING,1,ERROR,0}] [-l LOG_PATH]
               {convert,validate,attach-labels} ...

9.3.3.6.1. Positional Arguments#

data_command

Possible choices: convert, validate, attach-labels

9.3.3.6.2. Named Arguments#

-v, --log-level

Possible choices: DEBUG, 3, INFO, 2, WARNING, 1, ERROR, 0

set verbosity level by string or number, 0=ERROR, 1=WARNING, 2=INFO and 3=DEBUG

Default: “INFO”

-l, --log-path

set log file to log messages to disk, if not specified, the logs will only be output to console

9.3.3.6.3. Sub-commands#

convert#

Convert structure/CSV file → deepmd/npy (format auto-detected)

dpa-adapt data convert [-h] [-v {DEBUG,3,INFO,2,WARNING,1,ERROR,0}]
                       [-l LOG_PATH] --input INPUT --output OUTPUT [--fmt FMT]
                       [--type-map TYPE_MAP] [--no-validate] [--strict]
                       [--property-name PROPERTY_NAME]
                       [--property-col PROPERTY_COL] [--smiles-col SMILES_COL]
                       [--mol-dir MOL_DIR] [--mol-template MOL_TEMPLATE]
                       [--train-ratio TRAIN_RATIO] [--split-seed SPLIT_SEED]
                       [--conformer-seed CONFORMER_SEED] [--overwrite]
Named Arguments#
-v, --log-level

Possible choices: DEBUG, 3, INFO, 2, WARNING, 1, ERROR, 0

set verbosity level by string or number, 0=ERROR, 1=WARNING, 2=INFO and 3=DEBUG

Default: “INFO”

-l, --log-path

set log file to log messages to disk, if not specified, the logs will only be output to console

--input
--output
--fmt

Format hint (auto-detected if omitted). Use ‘smiles’ for CSV+SMILES, otherwise dpdata format string (vasp/poscar, vasp/outcar, …).

--type-map
--no-validate

Default: True

--strict

Default: False

--property-name
--property-col

Default: “Property”

--smiles-col

Default: “SMILES”

--mol-dir
--mol-template

Filename template under –mol-dir; use {row} for the CSV row index.

Default: “id{row}.mol”

--train-ratio

Default: 0.9

--split-seed

Random seed for train/valid split (SMILES input).

--conformer-seed

Random seed for RDKit conformer generation (SMILES input).

--overwrite

Default: False

validate#

Sanity-check deepmd/npy directories

dpa-adapt data validate [-h] [-v {DEBUG,3,INFO,2,WARNING,1,ERROR,0}]
                        [-l LOG_PATH] --data DATA [DATA ...] [--strict]
Named Arguments#
-v, --log-level

Possible choices: DEBUG, 3, INFO, 2, WARNING, 1, ERROR, 0

set verbosity level by string or number, 0=ERROR, 1=WARNING, 2=INFO and 3=DEBUG

Default: “INFO”

-l, --log-path

set log file to log messages to disk, if not specified, the logs will only be output to console

--data
--strict

Default: False

attach-labels#

Attach .npy labels to deepmd/npy directory

dpa-adapt data attach-labels [-h] [-v {DEBUG,3,INFO,2,WARNING,1,ERROR,0}]
                             [-l LOG_PATH] --data DATA --head HEAD
                             [--head-json] --values VALUES
Named Arguments#
-v, --log-level

Possible choices: DEBUG, 3, INFO, 2, WARNING, 1, ERROR, 0

set verbosity level by string or number, 0=ERROR, 1=WARNING, 2=INFO and 3=DEBUG

Default: “INFO”

-l, --log-path

set log file to log messages to disk, if not specified, the logs will only be output to console

--data
--head
--head-json

Default: False

--values