Deep Declarative Networks: A New Hope
Stephen Gould, Richard Hartley, Dylan Campbell
TL;DR
Deep Declarative Networks (DDNs) replace explicit forward mappings with optimization-defined behaviors, enabling end-to-end learning by backpropagating through implicitly defined node outputs via the implicit function theorem. The framework subsumes conventional neural networks, supports both declarative and imperative nodes, and leverages classical constrained/unconstrained optimization as modular layers. The authors derive gradient expressions for unconstrained, equality-constrained, and inequality-constrained nodes, discuss feasibility and non-smooth cases, and demonstrate practical implementations in PyTorch with robust pooling and $L_p$ projection examples. Experiments on image and point-cloud classification show robustness and calibration benefits from declarative components, suggesting broader applicability to model-based reasoning and constrained representations. Overall, DDNs offer a principled route to incorporate physical models, geometric constraints, and non-differentiable steps into deep learning while preserving differentiable end-to-end learning.
Abstract
We explore a new class of end-to-end learnable models wherein data processing nodes (or network layers) are defined in terms of desired behavior rather than an explicit forward function. Specifically, the forward function is implicitly defined as the solution to a mathematical optimization problem. Consistent with nomenclature in the programming languages community, we name these models deep declarative networks. Importantly, we show that the class of deep declarative networks subsumes current deep learning models. Moreover, invoking the implicit function theorem, we show how gradients can be back-propagated through many declaratively defined data processing nodes thereby enabling end-to-end learning. We show how these declarative processing nodes can be implemented in the popular PyTorch deep learning software library allowing declarative and imperative nodes to co-exist within the same network. We also provide numerous insights and illustrative examples of declarative nodes and demonstrate their application for image and point cloud classification tasks.
