I'm learning about a binary classifier. It uses the cross-entropy function as its loss function.
$y_i \log p_i + (1-y_i) \log(1-p_i)$
But why does it use the log function? How about just use linear form as follows?
$y_ip_i + (1-y_i)(1-p_i)$
Is there any advantage to use log function?
And an other question:
Log function maps (0,1) to (-inf, 0). So I think it can crush the algorithm if we get 0 for $p_i$ or $1-p_i$ because log value would be -inf and back-prop will be exploded.