Neural Networks With Virtual Physical Constraints