A logistic unit outputs p=σ(z). On one example the label is y=0 but the model is confidently wrong: p=0.99.
Using σ′(z)=σ(z)(1−σ(z)) from the CS229 derivation:
- log loss L=−[ylogp+(1−y)log(1−p)] has ∂z∂L=p−y
- squared error L=21(p−y)2 has ∂z∂L=(p−y)p(1−p)
What are the two gradients at this example?