35. Getting your Matrix Dimensions Right
2023. 9. 9. 17:20ㆍGoogle ML Bootcamp/1. Neural Networks and Deep Learning
np.dot(W,x)가 진행되므로 해당 layer의 (output dim, input dim)으로 설정된다.
W[l].shape : (n[l], n[l-1])
b[l].shape : (n[l],1)
- element-wise 더하기를 진행해야하므로 W[l]와 b[l]은 차원이 같아야한다.
이때 np.dot(W,x)가 아니라 np.dot(W,X) 모든 훈련 예제에 대해 진행된다면
X.shape : (n[0],m)
- Z[l].shape : (n[l], m)
- z[l].shape : (n[l],1)
- b[l].shape : (n[l],1) but python boradcasting -> (n[l],m)으로 열 복사가 진행되므로 element-wise 연산 가능.
역전파 진행 시 dimension 계산할때.
dZ[l].shape : (n[l],m)
'Google ML Bootcamp > 1. Neural Networks and Deep Learning' 카테고리의 다른 글
37. Building Blocks of Deep Neural Networks (0) | 2023.09.09 |
---|---|
36. Why Deep Representations? (0) | 2023.09.09 |
34. Forward Propagation in a Deep Network (0) | 2023.09.09 |
33. Deep L-layer Neural Network (0) | 2023.09.09 |
32. Random Initialization (1) | 2023.09.09 |