Loop over labels, not samples.
Sigmoid gradient.
Submitting my changes so far...