Physics Constrained Learning in Neural Network based Modeling