Learn Before
Example

Detaching Computation Example

Consider a scenario with variables defined as y=x∗xy = x * x and z=x∗yz = x * y. To isolate the direct influence of xx on zz without accounting for its indirect influence through yy, we introduce a detached variable, uu. This variable uu takes the same numerical value as yy, but its computational history is erased. When we compute the gradient of the new relation z=x∗uz = x * u with respect to xx, the result is simply uu (which equals x2x^2). In contrast, differentiating the fully connected expression z=x∗x∗xz = x * x * x would erroneously yield 3∗x∗x3 * x * x for this specific goal.

0

1

Updated 2026-05-02

Contributors are:

Who are from:

Tags

D2L

Dive into Deep Learning @ D2L