4.25. Use dp show to show the model information#

The dp show command is designed to display essential information about a trained model checkpoint or frozen model file. This utility helps to understand the model’s architecture, configuration, and parameter statistics in both single-task and multi-task settings.

4.25.1. Command Syntax#

dp --pt show <INPUT> <ATTRIBUTES...>
  • <INPUT>: Path to the model checkpoint file or frozen model file.

  • <ATTRIBUTES>: One or more information categories to display. Supported values are:

    • model-branch: Shows available branches for multi-task models.

    • type-map: Shows the type mapping used by the model.

    • descriptor: Displays the model descriptor parameters.

    • fitting-net: Displays parameters of the fitting network.

    • size: (Supported Backends: PyTorch and PaddlePaddle) Shows the parameter counts for various components.

    • observed-type: (Supported Backends: PyTorch) Shows the observed types (elements) of the model during data statistics. Only energy models are supported now.

4.25.2. Example Usage#

# For a multi-task model (model.pt)
dp show model.pt model-branch type-map descriptor fitting-net size

# For a single-task frozen model (frozen_model.pth)
dp show frozen_model.pth type-map descriptor fitting-net size

4.25.3. Output Description#

Depending on the provided attributes and the model type, the output includes:

  • Model Type

    • Logs whether the loaded model is a singletask or multitask model.

  • model-branch

    • Only available for multitask models.

    • Lists all available model branches and the special "RANDOM" branch, which refers to a randomly initialized fitting net.

  • type-map

    • For multitask models: Shows the type map for each branch.

    • For singletask models: Shows the model’s type map.

  • descriptor

    • For multitask models: Displays the descriptor parameter for each branch.

    • For singletask models: Displays the descriptor parameter.

  • fitting-net

    • For multitask models: Shows the fitting network parameters for each branch.

    • For singletask models: Shows the fitting network parameters.

  • size

    • Prints the number of parameters for each component (descriptor, fitting-net, etc.), as well as the total parameter count.

  • observed-type

    • Displays the count and list of observed element types of the model during data statistics.

    • For multitask models, it shows the observed types for each branch.

    • Note: This info shows the types observed during training data statistics, which may differ from the type map.

4.25.4. Example Output#

For a singletask model, the output might look like:

This is a singletask model
The type_map is ['O', 'H', 'Au']
The descriptor parameter is {'type': 'se_e2_a', 'sel': [46, 92, 4], 'rcut': 4.0}
The fitting_net parameter is {'neuron': [24, 24, 24], 'resnet_dt': True, 'seed': 1}
Parameter counts:
Parameters in descriptor: 19,350
Parameters in fitting-net: 119,091
Parameters in total: 138,441
The observed types for this model:
Number of observed types: 2
Observed types: ['H', 'O']

For a multitask model, if model-branch is selected, it will additionally display available branches:

This is a multitask model
Available model branches are ['branch1', 'branch2', 'RANDOM'], where 'RANDOM' means using a randomly initialized fitting net.
...