DPL302_-_FE_-_SU_2023_466.webp
Q

DPL302_-_FE_-_SU_2023_466.webp

(Choose 1 answer)
Consider the following code:
a = np.random.randn(3, 3)
b = np.random.randn(3, 1)
c = a*b
What will be c?
A. This will invoke broadcasting, so b is copied three times to become (3,3), and * is an element-wise product soc.shape = (3, 3).
B. This will invoke broadcasting, so b is copied three times to become (3,3), and invokes a matrix multiplication operation of two 3x3 matrics so c.shape will be (3, 3).
C. This will multiply a 3x3 matrix a with a 3x1 vector, thus resulting in a 3x1 vector. That is, c.shape = (3, 1).
D. It will lead to an error since cannot user "*" to operate on these two matrices. You nee instead use np.dot(a,b)

Exit 17

Thông tin

Category
DPL302m
Thêm bởi
Quang Thái
Ngày thêm
Lượt xem
887
Lượt bình luận
5
Rating
0.00 star(s) 0 đánh giá

Image metadata

Filename
DPL302_-_FE_-_SU_2023_466.webp
File size
61.8 KB
Dimensions
1542px x 690px

Share this media

Back
Bên trên Bottom