Chosen label 1
dW = —
dB = —
new W = —
new B = —
WEIGHT STEP—
Predict the direction, differentiate the real graph, then flip only the label. The forward prediction stays fixed; the gradient reverses.
Why. For sigmoid plus binary cross-entropy, the backward signal simplifies to p − y. The weight gradient multiplies that signal by x. Gradient descent subtracts the gradient, so changing the target can reverse the update even though the prediction is identical.
The prediction does not know the target. The loss does. Backprop carries that target-relative error backward, and the optimizer follows the resulting slope.