Batch Matrix-form Equations and Implementation of Multilayer Perceptrons

📅 2025-11-14
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
Existing literature often lacks a complete, mathematically rigorous batched matrix formulation for multilayer perceptrons (MLPs), relying instead on sample-wise expressions or automatic differentiation—limiting transparent analysis and system-level optimization, especially in sparse-network scenarios. This work introduces the first symbolically verified, fully batched matrix formalism for MLPs, explicitly deriving forward and backward propagation formulas—including BatchNorm and Softmax layers—with mathematical precision. We implement a unified, cross-framework reference implementation (NumPy, PyTorch, JAX, TensorFlow, and C++) built from a minimal set of matrix primitives. Gradient correctness is formally validated using SymPy, and empirical evaluation demonstrates efficacy in pedagogy, sparse computation optimization, and interpretability research. Our framework establishes a principled, analyzable, and extensible algorithmic foundation for neural network design and analysis. (149 words)

Technology Category

Application Category

📝 Abstract
Multilayer perceptrons (MLPs) remain fundamental to modern deep learning, yet their algorithmic details are rarely presented in complete, explicit emph{batch matrix-form}. Rather, most references express gradients per sample or rely on automatic differentiation. Although automatic differentiation can achieve equally high computational efficiency, the usage of batch matrix-form makes the computational structure explicit, which is essential for transparent, systematic analysis, and optimization in settings such as sparse neural networks. This paper fills that gap by providing a mathematically rigorous and implementation-ready specification of MLPs in batch matrix-form. We derive forward and backward equations for all standard and advanced layers, including batch normalization and softmax, and validate all equations using the symbolic mathematics library SymPy. From these specifications, we construct uniform reference implementations in NumPy, PyTorch, JAX, TensorFlow, and a high-performance C++ backend optimized for sparse operations. Our main contributions are: (1) a complete derivation of batch matrix-form backpropagation for MLPs, (2) symbolic validation of all gradient equations, (3) uniform Python and C++ reference implementations grounded in a small set of matrix primitives, and (4) demonstration of how explicit formulations enable efficient sparse computation. Together, these results establish a validated, extensible foundation for understanding, teaching, and researching neural network algorithms.
Problem

Research questions and friction points this paper is trying to address.

Providing batch matrix-form equations for multilayer perceptrons
Deriving forward and backward equations for all standard layers
Enabling transparent analysis and optimization for sparse networks
Innovation

Methods, ideas, or system contributions that make the work stand out.

Batch matrix-form equations for MLPs
Symbolic validation using SymPy library
Uniform implementations across multiple frameworks
🔎 Similar Papers
No similar papers found.