graph-pes-test
¶
Use the graph-pes-test
command to test a trained model.
Testing functionality is already baked into graph-pes-train
, but this command
allows you more fine-grained control over the testing process.
Usage¶
graph-pes-test test-config.yaml model_path=path/to/model.pth
graph-pes-test -h
usage: graph-pes-test [-h] [args ...]
Test a GraphPES model using PyTorch Lightning.
positional arguments:
args Config files and command line specifications.
Config files should be YAML (.yaml/.yml) files.
Command line specifications should be in the form
my/nested/key=value. Final config is built up from
these items in a left to right manner, with later
items taking precedence over earlier ones in the
case of conflicts. The data2objects package is used
to resolve references and create objects directly
from the config dictionary.
optional arguments:
-h, --help show this help message and exit
Example¶
data:
dimers:
+file_dataset:
path: path/to/dimers.xyz
cutoff: 5.0
amorphous:
+file_dataset:
path: path/to/amorphous.xyz
cutoff: 5.0
accelerator: gpu
loader_kwargs:
batch_size: 64
num_workers: 4
Config¶
- class graph_pes.config.testing.TestingConfig[source]¶
Configuration for testing a GraphPES model.
- data: GraphDataset | dict[str, GraphDataset]¶
Either:
a single
GraphDataset
. Results will be logged as"<prefix>/<metric>"
.a mapping from names to datasets. Results will be logged as
"<prefix>/<dataset-name>/<metric>"
, allowing for testing on multiple datasets.
- loader_kwargs: dict[str, Any]¶
Keyword arguments to pass to the
GraphDataLoader
.Defaults to:
loader_kwargs: batch_size: 2 num_workers: 0
You should tune this to make testing faster.
- torch: TorchConfig¶
The torch configuration to use for testing.
- logger: Literal['auto', 'csv'] | dict[str, Any] = 'auto'¶
The logger to use for logging the test metrics.
If
"auto"
, we will attempt to find the training config from<model_path>/../train-config.yaml
, and use the logger from that config.If
"csv"
, we will use a CSVLogger.If a dictionary, we will instantiate a new
WandbLogger
with the provided arguments.