cayleypy.models.load_checkpoint

cayleypy.models.load_checkpoint(path: str | PathLike, device: str = 'cpu', graph_def: CayleyGraphDef | None = None) → tuple[Module, ModelConfig][source]

Loads model from a checkpoint written by save_checkpoint().

The returned model is in evaluation mode.

Parameters:
  • path – Path to the checkpoint file.

  • device – PyTorch device to load the model to.

  • graph_def – Definition of the graph this model is going to be used with (optional). If given, and the checkpoint contains hash of the graph it was trained for, these graphs must be the same.

Returns:

Pair (model, config describing this model).