What is NexusModel?
The computation layer of a neural network. Every step under your control.
01The engine inside a model#
NexusModel is the C++20 layer library in the Nexus ecosystem. It runs tensors through layers, computes input derivatives, and accumulates learnable-parameter gradients. A common Module interface supports MLPs, convolutional networks, recurrent networks, and Transformer blocks.
02Separation of responsibilities#
NexusData loads data; NexusModel predicts; NexusLoss computes loss and external dL/dy; NexusOptim updates parameters. MatrixFlash Pro provides an optional GPU matrix multiplication bridge. The core does not link the three sibling training libraries; only the end-to-end example links them.
03The central contract#
forward(x) produces output and a backward cache. backward(dy) returns input gradients and adds to parameter gradients with +=. Call zero_grad() at the start of a new step. Do not insert another forward on the same object before its corresponding backward.
04Current scope#
Computation and storage use float32, with host CPU execution by default. Global autograd, automatic device transfer, FP16/BF16 training, optimizers, and data loaders are outside this core. Modules own mutable buffers; concurrency requires separate replicas. On the evening of 2026-10-21, AVX-512 was not selected on this Ryzen 7 5800H. The competitor-protocol GEMM kept kernel avx2-4x16: N=2048 Nexus 330, 362, and 369 GFLOPS, TensorFlow 389. CPU Conv2d was behind PyTorch at 31.6 GFLOPS; Nexus was about 4.9 to 6.8 GFLOPS. Depthwise AVX was ahead of PyTorch 4.93 and TensorFlow 0.688 on that column. There is no world ranking.