A Physics-Informed Neural Network is the canonical soft constraint. It leaves the hypothesis class untouched and folds the physics into the loss as a penalty whose zero-locus is the constraint surface.
A Physics-Informed Neural Network (PINN) fits a field , a plain neural network in the input coordinates, by minimising a data-fit term plus a penalty , where is the governing partial differential equation (PDE) and the residual is evaluated by automatic differentiation at a finite set of collocation points. Boundary and initial conditions enter the same way, as further penalty terms measuring their own residuals. The solution manifold, the set of fields satisfying together with its data, is the constraint surface that the penalty pulls the network towards. The method is due to Raissi, Perdikaris & Karniadakis.
Written out, the objective is a data term plus a physics term,
with collocation points drawn from the domain and every derivative in taken by automatic differentiation of in its inputs, nested once more for each extra order. For the heat equation the residual is , and the boundary and initial conditions add their own squared-residual terms. The same construction targets harder systems such as the incompressible Navier–Stokes equations, whose residual penalises the momentum and divergence-free conditions at the collocation points. Minimising is the whole method. The physics enters only through this penalty.
Soft versus hard constraints, the taxonomy contrast
A soft constraint does not restrict the space of maps. The hypothesis class stays the full network family; the PDE is imposed only as a Lagrangian relaxation, a penalty added to the objective, so holds only approximately and only in the training limit. Contrast a hard constraint, which reshapes the hypothesis class itself so that every representable map lies on the constraint surface by construction. The sibling soft constraint is the topological-loss; hard-constraint architectures such as geometric-deep-learning, topological-deep-learning, and the machine-learning-interatomic-potential instead build the invariance into the maps.