Batch Matrix-form Equations and Implementation of Multilayer Perceptrons

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Wesselink, Wieger, Grooten, Bram, van de Wetering, Huub, Xiao, Qiao, Mocanu, Decebal Constantin
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866908654664417280
author Wesselink, Wieger
Grooten, Bram
van de Wetering, Huub
Xiao, Qiao
Mocanu, Decebal Constantin
author_facet Wesselink, Wieger
Grooten, Bram
van de Wetering, Huub
Xiao, Qiao
Mocanu, Decebal Constantin
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2511_11918
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Batch Matrix-form Equations and Implementation of Multilayer Perceptrons
Wesselink, Wieger
Grooten, Bram
van de Wetering, Huub
Xiao, Qiao
Mocanu, Decebal Constantin
Machine Learning
Artificial Intelligence
68T07 (Primary)
I.2.6
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.
title Batch Matrix-form Equations and Implementation of Multilayer Perceptrons
topic Machine Learning
Artificial Intelligence
68T07 (Primary)
I.2.6
url https://arxiv.org/abs/2511.11918