Checkpoint
Matrices are machines
Twelve questions on matrices as maps, products, shapes and layers, with new numbers and a few classic traps. Work them without the lessons open. You need 80% to pass. The code question needs one line of numpy.
- Question 1 of 12.
A linear map sends to and to . Which matrix represents it?
- Question 2 of 12.
Compute for and . Enter the result as a column, top to bottom.
AxOne entry per box, top to bottom. 0.25, -2, 3/4 and sqrt(2) all work. Enter moves to the next empty box.
- Question 3 of 12.
Which of these can be done by multiplying by a matrix? Select all that apply.
Choose every option that applies.
- Question 4 of 12.
Find the single matrix that first applies the shear and then stretches horizontally by 3 with . Enter the matrix row by row.
One entry per box, row by row (Tab moves along a row). 0.25, -2, 3/4 and sqrt(2) all work. Enter moves to the next empty box.
- Question 5 of 12.
Let and . What is , the entry in row 2 and column 1?
Type a number: 0.25, -2, 3/4 and sqrt(2) all work.
- Question 6 of 12.
In numpy,
ahas shape(8, 1)andbhas shape(3,). What doesa + bdo? - Question 7 of 12.
An MLP maps 20 input features through two hidden layers of 50 units each to 5 outputs. Every layer is dense with a bias. How many parameters does it have? Enter a whole number.
Type a number: 0.25, -2, 3/4 and sqrt(2) all work.
- Question 8 of 12.
Which expression equals for matrices whose shapes fit?
- Question 9 of 12.
is , is and is . You compute with whichever grouping is cheaper. How many multiply-adds does it take? Enter a whole number.
Type a number: 0.25, -2, 3/4 and sqrt(2) all work.
- Question 10 of 12.
Two dense layers with no nonlinearity between them compute in the row-batch convention. Which single layer gives the same outputs?
- Question 11 of 12.
Write the matrix that rotates the plane a quarter turn clockwise. Enter the matrix row by row.
One entry per box, row by row (Tab moves along a row). 0.25, -2, 3/4 and sqrt(2) all work. Enter moves to the next empty box.
- Question 12 of 12.
Run the tests before you submit. This question counts as correct if your latest run passes every check.
Code it A colleague stores a layer's weights in the math convention:
Whas shape(d_out, d_in), so one input column becomes . Your data is a batchXof shape(batch, d_in), one example per row. Writelayer(X, W, b)so that it returns every example's output as a row, shape(batch, d_out), without a Python loop.Write your code where the starter saysraise NotImplementedError, then press Run tests. Each check says what it expects.