ModelArchive
classin packageklyn.math.nn.serialization
public class ModelArchive<T extends AbstractFloat>
ModelArchive

Strict KNN 1.0 sequential model transport. A bounded JSON manifest describes allowlisted operators; aligned binary blocks preserve exact FP16/FP32/FP64 bits. SHA-256 detects corruption, not authenticity. Loading never evaluates code, resolves arbitrary types or follows paths supplied by a checkpoint.

Example

checkpoint = ModelArchive<Float>.read(Path("model.knn"))

Methods
Modifier and Type Member Description
public static dtype
dtype() as String
Public precision identifier.
public static read
read(path as Path, maxBytes as ULong = 2147483648ul) as ModelCheckpoint<T>
Loads and validates all architecture, ranges and checksums before publication.
public static write
write(path as Path, layers as IList<Layer<T>>, inputShape as IList<Long>, optimizer as Optimizer<T>, loss as ClassificationLoss<T>, gradientScale as Double, finiteBatches as Long, includeOptimizer as Boolean = true, regressionLoss as RegressionLoss<T> = null) as Void
Writes a built sequential model using bounded I/O and atomic replacement.