klyn.math.nn.Sequential.save
method
public save(path as Path, includeOptimizer as Boolean = true) as Void
Description

Saves architecture, exact parameter bits and optional training state to KNN 1.0. Built-in stages include convolutions, transposed convolutions, pooling, Dropout and activations. Custom classes are explicitly rejected. GPU parameters are synchronized; the selected device is not persisted. The model must be built and must not be mutated concurrently. Publication replaces an older checkpoint atomically only after a complete write.

Parameters
ParameterDescription
pathDestination, normally ending in .knn. No extension also uses KNN.
includeOptimizerFalse creates an uncompiled inference checkpoint.
Throws
  • ValueException for unbuilt/unsupported models; IOException for I/O.
Example

model.save(FilePath("MnistCNN.knn"))