Deepity
Ultra-fast, SIMD-accelerated Predictive Coding
Loading...
Searching...
No Matches
Deep::ModelIO Class Reference

Static save/load helpers for any network type exposing GetLayers() – templated so it works across every PC network variant without each one reimplementing serialization. More...

#include <ModelIO.h>

Static Public Member Functions

template<typename NetworkType>
static bool Save (const NetworkType &net, const std::string &filepath)
 Writes net's weights to a single file at filepath: a JSON header (per-layer tensor shapes/offsets) followed by the raw float data, back to back.
template<typename NetworkType>
static bool Load (NetworkType &net, const std::string &filepath)
 Reads a file written by Save() back into net's already-compiled weight arena, matching each tensor by the same "layer_N.name" key Save() wrote it under.

Detailed Description

Static save/load helpers for any network type exposing GetLayers() – templated so it works across every PC network variant without each one reimplementing serialization.

Member Function Documentation

◆ Load()

template<typename NetworkType>
bool Deep::ModelIO::Load ( NetworkType & net,
const std::string & filepath )
inlinestatic

Reads a file written by Save() back into net's already-compiled weight arena, matching each tensor by the same "layer_N.name" key Save() wrote it under.

Returns
false if filepath couldn't be opened for reading; true on success.

◆ Save()

template<typename NetworkType>
bool Deep::ModelIO::Save ( const NetworkType & net,
const std::string & filepath )
inlinestatic

Writes net's weights to a single file at filepath: a JSON header (per-layer tensor shapes/offsets) followed by the raw float data, back to back.

Returns
false if filepath couldn't be opened for writing; true on success.

The documentation for this class was generated from the following file: