A = numpy.array([ 1 , 2, 3 ]) : 1차원 -> numpy.shape(A) = (3, ) // A array의 dim 0 값은 3! # numpy array의 차원 인덱스는 0차원부터 시작한다! B = numpy.array([ [ 1 , 2 , 3 ] , [ 3 , 4 , 5 ] ]) : 2차원 행렬-> numpy.shape(B) = (2, 3) // B array의 dim 0 값은 2, dim 1 값은 3!
numpy 배열에 부등호 연산을 적용하면, BOOL 타입의 배열이 생성된다! e.g x = np.array([[ -1 , 1 ],[ 3 , -2 ]]) y = x > 0 (x array에서 0보다 큰 것!) y = array([ False , True ], [ True , False ]) def activation_step(x): y = x > 0 return y.astype( np.int ) //bool type y 받아 true는 1, false는 0 으로 변환하여 출력. //astype(원하는 자료형) 출처: deep learning form
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의..
Start IPython Location of image data: cs231n/datasets/cifar-10-batches-py Start jupyter notebook in the Virtual environment - in assignment folder. (assignment path) : source .env/bin/activate jupyter notebook localhost:8888/tree web browser가 실행된다. jupyter notebook을 실행시킨 디렉토리를 웹 브라우저에서 확인할 수 있다. Shift-Enter -> python code cell 단위로 실행시키는 것 Global variable은 cell간에도 공유된다. Save changes!!
해당 글은 Stanford CS class CS231n: Convolutional Neural Networks for Visual Recognition 강의를 기반으로 하고 있습니다.(출처 :http://cs231n.stanford.edu/syllabus.html) Video 강의와 강의 note를 가지고 정리하고 있습니다.Convolution and poolingConNets outside vision
해당 글은 Stanford CS class CS231n: Convolutional Neural Networks for Visual Recognition 강의를 기반으로 하고 있습니다.(출처 :http://cs231n.stanford.edu/syllabus.html) Video 강의와 강의 note를 가지고 정리하고 있습니다.Backpropagation'neural network에서 parameter를 학습시킬 때, 좋은 성능의 모델을 얻으려 optimization하는 방법으로 - gradient를 따라간다'이전 정리에서 말씀드린 것 기억하시나요? gradient()는 해당 포지션 p 에서 가장 급격하게 기울기가 상승하는 방향을 나타냅니다. loss function 가 주어진 상황에서 우리가 해야할 일은,..
해당 글은 Stanford CS class CS231n: Convolutional Neural Networks for Visual Recognition 강의를 기반으로 하고 있습니다.(출처 :http://cs231n.stanford.edu/syllabus.html) Video 강의와 강의 note를 가지고 정리하고 있습니다.Regularization이전 정리에서 모델의 성능을 평가할 때, 'Weight parameter가 잘 학습되어 총 loss 값이 0에 가까운가'를 기준으로 한다는 것을 배웠습니다. 그런데 여기서 주의할 점이 있습니다. 우리가 만든 모델의 loss 를 0으로 만드는 W parameter matrix가 오직 하나만 존재할까요? 예를 들어 총 loss 값을 0으로 만드는 아주 정확하게 클..
해당 글은 Stanford CS class CS231n: Convolutional Neural Networks for Visual Recognition 강의를 기반으로 하고 있습니다.(출처 :http://cs231n.stanford.edu/syllabus.html) Video 강의와 강의 note를 가지고 정리하고 있습니다.Recall... Linear ClassificationLinear classifier와 같은 분류 모델을 설정하고 나면 해야할 일 두가지가 있습니다. 1. Define a loss function loss function은 classifier의 성능을 보여주는 척도입니다. loss function 값이 작을 수록, 즉 0에 가까울수록 classifier가 데이터 샘플을 잘 분류하는 ..