A Semantic-Loss Function Modeling Framework With Task-Oriented Machine Learning Perspectives