SnareNet: Flexible Repair Layers for Neural Networks with Hard Constraints
Ya-Chi Chu, Alkiviades Boukas, Madeleine Udell
TL;DR
SnareNet addresses the problem of enforcing nonlinear, input-dependent constraints in neural networks by introducing a differentiable repair layer guided by adaptive relaxation. The method combines an adaptive Newton update with Levenberg–Marquardt regularization to navigate toward the intersection of the constraint range and the feasible set, progressively tightening constraints during training. Empirically, SnareNet yields higher-quality solutions while satisfying constraints with user-defined tolerance across optimization-learning tasks and neural control policies, outperforming soft-constraint and several hard-constraint baselines. This approach offers a practical, end-to-end framework for safety- and feasibility-critical applications where constrained outputs are essential for real-world deployment.
Abstract
Neural networks are increasingly used as surrogate solvers and control policies, but unconstrained predictions can violate physical, operational, or safety requirements. We propose SnareNet, a feasibility-controlled architecture for learning mappings whose outputs must satisfy input-dependent nonlinear constraints. SnareNet appends a differentiable repair layer that navigates in the constraint map's range space, steering iterates toward feasibility and producing a repaired output that satisfies constraints to a user-specified tolerance. To stabilize end-to-end training, we introduce adaptive relaxation, which designs a relaxed feasible set that snares the neural network at initialization and shrinks it into the feasible set, enabling early exploration and strict feasibility later in training. On optimization-learning and trajectory planning benchmarks, SnareNet consistently attains improved objective quality while satisfying constraints more reliably than prior work.
