Intelligence.
At its core._
Build your model. See the computation.
Take control of every gradient.
C++20 neural-network layers and explicit backward. A plain interface, with the mathematics inside the layer.
Y 00.64
Z 00.32
SIMD / scalar speed ratio
2026-09-29 · Linear · 256Forward + backward
Same Linear workloadAligned tensor storage
Float32 · shared storageOne contract for every layer
forward(x) / backward(dy)Open the black box.
Understand every step.
Data, layers, loss, and updates. An ecosystem with clear responsibilities and a computation flow you can follow.
x: TensorPrepare datay = model.forward(x)Run computationdL / dyProduce gradientsθ ← optimizer.step()Update weightsExplicit backward. No shared global tape required.
Close to the hardware.
Runtime-selected SIMD kernels. 64-byte aligned, reusable buffers.
Explore CPU architecture ↗Derivatives, visible.
Analytic backward in layers. A small, layer-local MicroTape inside attention.
Understand backward ↗Made to compose.
Compose with Sequential. Extend with Module. Go directly from mathematics to implementation.
Explore modules ↗From idea to architecture.
Layer by layer.
Also included: Normalization·11 activations·Pooling·Embedding·Dropout
One workload.
The 29 September table.
The bars are the 29 September 2026 single-thread Linear measurement. The evening of 21 October 2026 on this Ryzen 7 5800H is separate. GEMM kept kernel avx2-4x16. At N=2048 Nexus recorded 330, 362, and 369 GFLOPS; TensorFlow recorded 389. CPU Conv2d was behind PyTorch at 31.6 GFLOPS. Nexus that evening was about 4.9 to 6.8 GFLOPS. Depthwise AVX was ahead of PyTorch 4.93 and TensorFlow 0.688. AVX-512 is not selected on this CPU. There is no world ranking.
NexusModel · NumPy · PyTorchLess code.
Full control.
Define the model, pass the input, send the external gradient back. Your first working example, right here.
#include <nexus_model/nexus_model.hpp>#include <iostream>#include <memory>using namespace nexus_model;int main() { init::manual_seed(42); Sequential model({ std::make_shared<Linear>(784, 256), std::make_shared<GELU>(), std::make_shared<Linear>(256, 10) }); auto x = Tensor::full({32, 784}, 0.1f); model.zero_grad(); auto y = model.forward(x); // Example objective: L = sum(y). dL/dy = 1. auto dy = Tensor::full({32, 10}, 1.0f); auto dx = model.backward(dy); std::cout << y.size(0) << " x " << y.size(1) << "\n"; return dx.same_shape(x) ? 0 : 1;}An API that speaks the language of mathematics.
C++20 and a standard CMake build
Explicit input and output shapes
Directly accessible parameter gradients
Detailed guides grounded in source code
Open the installation guideExample uses L = sum(y). Add a loss and optimizer for real training.
Don’t just use it.
Understand it.
From tensor memory to attention mathematics. From a single line to the whole architecture.
Bu yazılım ekosistemi Bursa Teknik Üniversitesi Bilgisayar Mühendisliği 1. sınıf öğrencisi Muhammed Fatih Şahin tarafından yapay zeka destekli olarak geliştirilmiştir.
Explore the documentation