Diagonal matrices
A square diagonal matrix has zero entries off its main diagonal and multiplies each coordinate by its matching diagonal entry.
On this page 7 sections
01A square diagonal matrix has zeros off its main diagonal#
A square diagonal matrix has zeros off its main diagonal. Each diagonal entry scales one input coordinate.
For and , the first output is . The second is .
The output column vector is
Here and throughout this lesson, tuples list column-vector coordinates.
For , each factor stays with its own coordinate.
Coordinate by coordinate,
A zero factor erases that coordinate. A negative factor reverses its sign.
and . What is the second coordinate of ?
Show answer and explanation
The second factor is : .
02D=operatornamediag(2,3) sends (1,1) to (2,3)#
sends to . The first coordinate doubles; the second triples.
The equal factors in would instead double both coordinates. A diagonal matrix need not use one common multiplier.
A filter doubles channel 1 and silences channel 2. Choose its diagonal matrix.
Show answer and explanation
Use factors 2 and 0, in that order.
03Check your understanding#
sends to , a learner says. What needs fixing?
Show answer and explanation
The second entry also scales: .
Match each coordinate with its diagonal multiplier.
- Apply each diagonal entry to its matching coordinate.
Sources & further reading
- [1]Goodfellow, Bengio and Courville, Deep Learning (2016), 2.6 Special Kinds of Matrices and Vectors ↗Goodfellow, Bengio and Courville · Book