Cross entropy cost function in machine learning