01-relu's backward pass needed the original input x to know which elements were positive. Sigmoid's backward pass has a different, more efficient option: its derivative can be written entirely in terms of its own output, so a real autograd engine never needs to keep the original input around at all once the forward pass has run.
01-classical-ml/02-classification's sigmoid already computed the forward formula, 1 / (1 + exp(-x)). This question keeps that forward pass and adds sigmoid_backward(grad_output, output), which takes the saved forward output, not x, a genuinely different signature from 01-relu's backward pass.
x: any NumPy array shape. sigmoid_forward returns the same shape, values strictly in (0, 1).sigmoid_backward(grad_output, output) takes the forward pass's own saved result, not the original x.sigmoid_forward must stay finite for any input, including very large |x|.Open one at a time. Each gives away a little more than the last.
Sigmoid's derivative has a closed form written purely in terms of sigmoid(x) itself — you don't need x at all in sigmoid_backward.
f'(x) = f(x) * (1 - f(x)) — multiply that factor into grad_output.
Click "Run Tests" to test your implementation