Read the equation
The local sensitivity to x is the current y value, and the sensitivity to y is the current x value. The backward pass multiplies each by the incoming gradient and accumulates the result. This is the product rule applied to one node of a computational graph.
Terms & definitions
| Term | Meaning in this source |
|---|---|
| x | First factor |
| y | Second factor |
| z | Product |
How it works
Read the definition from its right-hand expression to the quantity on the left. Its surrounding source records the intended input, state, or parameter context. Where the source leaves an operation unspecified, this page preserves that gap.
Assumptions & limits
Source recovery establishes that the expression appears in this record. Its mathematical validity, implementation behavior, and interpretation must be assessed separately. See the linked source and research notes for the checks available for this version.
Original context
Read the surrounding source passage
z->backward_fn = [x, y, z]() {
x->grad += z->grad;
y->grad += z->grad;
};
return tape.record(z);
}
// Multiplication: z = x * y, dz/dx = y, dz/dy = x
inline GradNodePtr mul(GradNodePtr x, GradNodePtr y, TapeRecorder& tape) {
auto z = std::make_shared<GradNode>(x->value * y->value);
z->inputs = {x, y};
z->backward_fn = [x, y, z]() {
x->grad += z->grad * y->value;
y->grad += z->grad * x->value;
};
return tape.record(z);
}
Exact original notation
Multiplication: z = x * y, dz/dx = y, dz/dy = x