I am using CNN to do binary classification.
While the cross-entropy function is calculated by the code:
(-1 / m) * np.sum(np.multiply(Y, np.log(AL)) + np.multiply(1 - Y, np.log(1 - AL)))
when the algorithm predicts a value of 1.0, this cost function gives a divide by zero warning. How to deal with it? Or is there any way to avoid the prediction to become exactly 1.0, like any pre-processing skill?
When I use higher numerical precision, it works fine. But I am still curious about the warning.