Pure Go zero-dependency deep learning engine with 13-channel spatial difference manifold calculus.
DiagonalNet is an autonomous deep learning engine implemented from scratch in 100% pure Go standard library without external dependencies, C bindings, or third-party packages, built for the Zero Dependency Hackathon 2026 (ZeroDepsHack). It features analytical Jacobian backpropagation, handcrafted 13-channel spatial difference manifold feature extraction (immediate diagonals and 8-way chess knight operators), contiguous cache-friendly 1D/3D flat tensors, He initialization, Adam optimizer with milestone step LR scheduling, lock-free data-parallel multi-core CPU training, and an embedded HTML5 canvas drawing web app with real-time sub-8ms CPU prediction.
Zero third-party packages, zero C bindings, and zero runtime imports. Every layer, tensor calculation, optimizer, and I/O routine is written natively in Go standard library.
Transforms 1-channel images into 13-channel manifolds in parallel across CPU rows: 4 immediate diagonals and all 8 chess knight-move differential operators.
Full analytical backward passes for Conv2D, AdaptiveAvgPool2D, Linear, ReLU, Dropout, and Softmax Cross-Entropy, mathematically proven against numerical finite-difference gradients.
Data-parallel BatchTrainer spawns CPU worker replicas, computes concurrent backward passes, and aggregates gradients into non-overlapping memory slices without mutex contention.
Tight bounding box location, dynamic proportional padding, peak contrast stretching, and sub-pixel continuous bilinear resampling to canonical 28x28 grids.
$git clone https://github.com/itznan/diagonalnet.git && cd diagonalnet$go test -v ./...$go run . train -profile normal -data data -model weights/diagonalnet_model.bin$go run . serve -model weights/diagonalnet_model.bin -port 8081Requires Go 1.22+. Produces a single static binary with zero runtime dependencies.
Self-contained single-page canvas web app embedded directly in Go binary string with real-time sub-8ms CPU prediction and auto browser launching.