v2026.11.2
All Bundles
Bundle

Convolutional neural networks on the CPU: layers with forward and backward passes, the Adam and SGD optimizers, an image dataset with train, validation and test splits and on-the-fly augmentation, and a training loop that records the metrics of every epoch. The layers are native (libobjk_ml, Eigen plus a small thread pool); this library holds the model API, the dataset and the trainer. Compile with -lib ml_cnn,ml,ml_lab,opencv,csv,json,cipher,gen_collect. Design, validation and measurements: docs/AI.md, "Convolutional networks (System.ML.Cnn)".

PendingImages

The images of one batch, being decoded in the background by ImageDataset->Begin (or ImageSubset->Begin). Get waits for the decoding the first time it is called. Close it when done: an unclosed batch holds its decoded pixels until the process ends.

Operations

Close #

Frees the decoded pixels (waiting for the decoding to end first). Safe to call twice.

method : public : Close() ~ Nil

Count #

The number of images.

method : public : Count() ~ Int

Return

TypeDescription
Intcount

Get #

The decoded pixels of the image at a position of this batch (size x size x channels bytes), the cached or in-memory pixels if it had them.

method : public : Get(position:Int) ~ Byte[]

Parameters

NameTypeDescription
positionIntposition in this batch, 0 .. Count - 1

Return

TypeDescription
Bytethe pixels, or Nil if the image cannot be decoded (the dataset's GetError says which)