19. A Note on Python/Numpy Vectors

2023. 9. 8. 23:15Google ML Bootcamp/1. Neural Networks and Deep Learning

import numpy as np

 

a = np.random.randn(5)

a.shape 

- (5,) : 1순위 배열이라고 부름.

- 이는 행 벡터나 열 벡터로 일관되게 동작하지 않음. 열벡터도 행벡터도 아님.

 

중요한것은 1순위 배열을 사용하지 않는 것.

a = np.random.randn(5,1) or a = np.random.randn(1,5)로 선언하여 사용.

a.shape

- (5,1) or (1,5)

행렬 차원을 구체화할 것.