Hard and soft constraints in Scientific machine learning (SciML)