Machine Learning Loss Function Definition