43void SaveCheckpoint(
const std::string& path,
Module& model,
const std::map<std::string, std::string>& metadata = {});
51 const std::map<std::string, std::string>& metadata = {});
Adam optimizer – operates uniformly across any Module's parameters().
Adam (Kingma & Ba, 2015): per-parameter moving averages of gradient (m) and squared gradient (v),...
Definition adam_optimizer.hpp:22
Base class for every layer type (LinearModule, Conv2DModule, activations, ...).
Definition module.hpp:78
Abstract base every layer subclasses – NVI forward(), pure-virtual LRP contract.
Definition acquisition_functions.hpp:16
constexpr int kCheckpointFormatVersion
The checkpoint format this build writes. Files record it as format_version; a file without one (any p...
Definition checkpoint.hpp:21
std::string OptimizerStatePath(const std::string &checkpoint_path)
Where the optimizer state for checkpoint_path is stored: model.safetensors becomes model....
void SaveCheckpoint(const std::string &path, Module &model, const std::map< std::string, std::string > &metadata={})
Writes every parameter and buffer of model, under their hierarchical names, to a safetensors file wit...
void LoadCheckpoint(const std::string &path, Module &model, CheckpointLoadOptions options={})
Loads parameters and buffers saved by SaveCheckpoint() (or any safetensors file whose names match) in...
Options for LoadCheckpoint().
Definition checkpoint.hpp:24
bool strict
Require the file and the model to have exactly the same names. Shapes are always checked.
Definition checkpoint.hpp:27