2
$\begingroup$

How to calculate cross entropy when actual output is 0? Would not it give indf brcause of log(0) and the cross entropy for binary classification is given by: -(ylog(actual_output)+(1-y)*(1-actual_output)

$\endgroup$
5
  • $\begingroup$ Hi there, Can you add some helper code, will help us in debugging easier, Also generally never you get a perfect 1, it's always like .9999 $\endgroup$ – Aditya Jun 2 '18 at 1:41
  • $\begingroup$ I am dealing with input number with value around 150 applying sigmoid to such value would give 1 $\endgroup$ – Dimitry Jun 2 '18 at 2:03
  • $\begingroup$ What your goal is exactly? $\endgroup$ – Aditya Jun 2 '18 at 2:05
  • $\begingroup$ I am building neural network for binary classification and input values always large in my case and that woud make sigmoid gives 1 and this will cause problem with cross entropy because of log(0) for the cross entropy and division on zero for it is derivation so what I want exctly is a way to make sure I do not get in this problems in cross entropy function $\endgroup$ – Dimitry Jun 2 '18 at 2:11
  • $\begingroup$ Did you normalise your inputs as nn doesn't work without it $\endgroup$ – Aditya Jun 2 '18 at 4:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.