Learn Before
Formula

Chain Rule for Tensors

The chain rule from calculus can be generalized to compute the derivative of a tensor Z\mathsf{Z} with respect to a tensor X\mathsf{X} via an intermediate tensor Y\mathsf{Y}, where all three tensors have arbitrary shapes. Assuming functions Y=f(X)\mathsf{Y}=f(\mathsf{X}) and Z=g(Y)\mathsf{Z}=g(\mathsf{Y}), the chain rule is expressed as: ZX=prod(ZY,YX)\frac{\partial \mathsf{Z}}{\partial \mathsf{X}} = \textrm{prod}\left(\frac{\partial \mathsf{Z}}{\partial \mathsf{Y}}, \frac{\partial \mathsf{Y}}{\partial \mathsf{X}}\right)

0

1

Updated 2026-05-06

Contributors are:

Who are from:

Tags

D2L

Dive into Deep Learning @ D2L

Related
Learn After