View on GitHub

maximal

A TensorFlow-compatible Python library that provides models and layers to implement custom Transformer neural networks. Built on TensorFlow 2.

Saving and Loading Models.

Author: Ivan Bongiorni - 2023-02-04.


Loading and saving maximal models (usually models that are composed of a mix of maximal and TensorFlow layers) is straightforward. Currently, the syntax is the one from tensorflow.keras. After you basic imports:

import tensorflow as tf
import maximal

in order to save a model simply run:

model.save("./path/to/model.h5")

The .h5 file extension is optional.

To load the same model:

from maximal.models import load

model = load('path/to/model.h5')

Future releases of maximal will include a .maximal model format.