Evaluating a model¶
- metatrain.utils.evaluate_model.evaluate_model(model: Module | MetatensorAtomisticModel | RecursiveScriptModule, systems: List[System], targets: Dict[str, TargetInfo], is_training: bool, check_consistency: bool = False) Dict[str, TensorMap] [source]¶
Evaluate the model (in training or exported) on a set of requested targets.
- Parameters:
model (Module | MetatensorAtomisticModel | RecursiveScriptModule) – The model to use. This can either be a model in training (
torch.nn.Module
) or an exported model (torch.jit._script.RecursiveScriptModule
).targets (Dict[str, TargetInfo]) – The names of the targets to evaluate (keys), along with their associated gradients (values).
is_training (bool) – Whether the model is being computed during training.
check_consistency (bool)
- Returns:
The predictions of the model for the requested targets.
- Return type: