Pylon lets you train your deep learning models with arbitrary constraints on the output.
Github Video