Learn Before
Example
Detaching Computation Example
Consider a scenario with variables defined as and . To isolate the direct influence of on without accounting for its indirect influence through , we introduce a detached variable, . This variable takes the same numerical value as , but its computational history is erased. When we compute the gradient of the new relation with respect to , the result is simply (which equals ). In contrast, differentiating the fully connected expression would erroneously yield for this specific goal.
0
1
Updated 2026-05-02
Tags
D2L
Dive into Deep Learning @ D2L