Local derivatives
A local derivative is the rate of change of one operation’s output with respect to an immediate input, holding its other inputs fixed.
On this page 8 sections
01A local derivative describes one operation’s response to one of its immediate inputs#
A local derivative describes one operation’s response to one of its immediate inputs. It temporarily ignores where that input came from. This lets a large model reuse small derivative rules for operations such as addition, multiplication, and squaring.
A local derivative measures one operation’s response to one of its input ports. Hold its other ports fixed. The notation asks how this gate’s output responds to input .
For , hold fixed. A change changes the output by , so the local rate is .
At , , the output is but the local rate on is .
For one multiplication node at , changing slightly scales that change by , so . Changing scales it by , giving . The forward value is neither of these derivatives.
Gate: . At , , find the local derivative .
Show answer and explanation
Hold fixed. The local derivative of with respect to is .
02Use the derivative rule for the gate itself#
Use the derivative rule for the gate itself. For , the local rate is . For , with fixed, it is . For , with fixed , it is .
The rate may depend on the gate’s current input value, so use the value from the forward pass.
and . Next gate: . Find the gate’s local rate .
Show answer and explanation
The local derivative of is . Exclude the upstream rate.
03If u=3x and z=u^2, the gate’s local rate is ∂ z/∂ u=2u#
If and , the gate’s local rate is . The rate with respect to the original also needs .
Those are different requested derivatives. Include the upstream factor only when the question asks for the response to that upstream input.
and . Next gate: . An answer includes . Repair .
Show answer and explanation
The local derivative of is . Exclude the upstream rate.
04A local derivative is one factor in a longer chain#
A local derivative is one factor in a longer chain. If itself depends on a weight, you must still include that dependence when finding the loss’s response to the weight. Stopping at a local derivative answers a different question.
Differentiate the requested gate with respect to the requested input port.
- Compute one graph operation's local derivative with respect to an input.
Sources & further reading
- [1]Stanford CS231n: Backpropagation ↗Stanford CS231n · Article