Designing Customized Loss Functions for Training Deep Neural Networks