Learn Before
Example

Detaching Computation Example

Consider a scenario with variables defined as y=xxy = x * x and z=xyz = 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=xuz = x * u with respect to xx, the result is simply uu (which equals x2x^2). In contrast, differentiating the fully connected expression z=xxxz = x * x * x would erroneously yield 3xx3 * x * x for this specific goal.

0

1

Updated 2026-05-02

Contributors are:

Who are from:

Tags

D2L

Dive into Deep Learning @ D2L