returns 1.0 when z is greater than 36. In this case log(1-sigmoid(z)) raises “Math domain” error.
This is due to python’s precision for floating point numbers.
When training, and printing out the cost, it crashes due to the reason I mentioned.
Anyone knows how to solve the problem?
When using the sigmoid() activation, typically the system will learn weight values that avoid generating large magnitude z values that cause this issue.