public static 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. Optimizer states describe continuation between fit calls; datasets, batches and the call-local shuffle permutation are not saved. No concurrent model mutation is permitted. Temporary files are private and always cleaned up.
| Parameter | Description |
|---|---|
path | Destination; no extension or .knn, never an external format. |
layers | Ordered allowlisted stages with initialized parameters. |
inputShape | Built input dimensions, excluding the batch axis. |
optimizer | Update rule or null. @param loss Classification loss or null. |
regressionLoss | Regression objective or null; mutually exclusive with loss. |
gradientScale | Dynamic loss scale. @param finiteBatches Growth counter. |
includeOptimizer | False produces an uncompiled inference checkpoint. |
ModelArchive<Float>.write(path, layers, [784l], optimizer, loss, 1.0, 0l)