Python numpy.reshape(-1)의 의미
cs231n assignment#1 CIFAR-10 data #Reshape the image data into rowsX_train = np.reshape(X_train, (X_train.shape[0], -1))X_test = np.reshape(X_test, (X_test.shape[0], -1)) print(X_train.shape, X_test.shape) //result: (5000, 3072) (500, 3072) basic form: np.reshape( data, (row, column)) data를 row * column form으로 reshape한다. 위 cs231n code에 의하면, CIFAR-10 Image data를 하나의 긴 vector form으로 바꿔 다루고자 numpy의..
Basic section/Python
2018. 2. 13. 16:00