Cost function form

Do we still use the logistic regression’s cost function form in Neural Network (-yloga - (1-y)log(1-a)? Or what kind of cost functions are most frequently used?

Yes, for binary classifications, we use the same cost function for Neural Networks as we do for Logistic Regression. You will see this in Week 3 and Week 4. Note that the output layer of a binary classification Neural Network looks exactly like Logistic Regression. Prof Ng makes this point in the Week 2 lectures, I think: you can look at Logistic Regression as a “trivial” Neural Network that omits all the hidden layers.

1 Like