CS231n Assignment2(4) : Convolutional Neural Networks
·
Stanford CS231n
CodeConvolution forward를 naive 하게 구현하는 함수입니다.Filter의 개수만큼 반복하며, activation map을 2중 포문으로 돌며 값을 하나씩 채워넣습니다. 이를 통해 convolution layer의 계산량을 구할 수 있습니다. (= Filter Size(H*W) x number of Filter x Output Size)def conv_forward_naive(x, w, b, conv_param): """ A naive implementation of the forward pass for a convolutional layer. The input consists of N data points, each with C channels, height H an..
CS231n Assignment 2(3) : Dropout
·
Stanford CS231n
Stanford에서 강의하는 CS231n의 Assignment 2: Dropout 을 정리한 글입니다.Inline Question 1What happens if we do not divide the values being passed through inverse dropout by p in the dropout layer? Why does that happen? Your Answer : 드롭아웃 값을 p로 나누지 않으면 학습시 출력 값의 평균이 감소하게 됩니다. 따라서, 이를 보정하기 위해 드롭아웃 값에 p를 곱해줍니다.Inline Question 2Compare the validation and training accuracies with and without dropout -- what do your..
CS231n Assignment 2(2) : BatchNormalization
·
Stanford CS231n
Inline Question 1Describe the results of this experiment. How does the weight initialization scale affect models with/without batch normalization differently, and why? Your Answer : 배치 정규화가 있는 모델은 배치 정규화가 없는 모델에 비해 넓은 weigt initialization scale에서 좋은 성능을 보입니다. 배치 정규화를 통해 internal covariate shift 문제를 해결할 수 있기 때문에 학습이 더 쉽습니다.Inline Question 2Describe the results of this experiment. What does this i..
CS231n Assignment 2(1) : Multi-Layer Fully Connected Neural Networks
·
Stanford CS231n
Stanford에서 강의하는 CS231n의 Assignment 2: Multi-Layer Fully Connected Neural Networks 를 정리한 글입니다.Inline Question 1Did you notice anything about the comparative difficulty of training the three-layer network vs. training the five-layer network? In particular, based on your experience, which network seemed more sensitive to the initialization scale? Why do you think that is the case? Your Answer : 3-l..
cs231n [collectSubmission.sh/makepdf.py] FileNotFoundError: [Errno 2] No such file or directory: 'knn.pdf'
·
Error
cs231n 과제 제출을 위해 .ipynb, .py 파일들을 pdf로 변환하고자 collect_submission.ipynb 파일을 실행시켰는데 오류가 발생합니다. [문제 해결]처음 collectSubmission.sh를 실행하기 이전에 pandoc 라이브러리도 같이 설치하면서 해결할 수 있습니다.%cd drive/MyDrive%cd $FOLDERNAME!sudo apt-get install texlive-xetex texlive-fonts-recommended texlive-plain-generic!pip install PyPDF2!sudo apt-get install pandoc!bash collectSubmission.sh[문제점 찾기]%cd drive/MyDrive%cd $FOLDERNAME!su..
CS231n Assignment 1(3) : Implement a Softmax classifier
·
Stanford CS231n
Stanford에서 강의하는 CS231n의 Assignment 1(3): Implement a Softmax classifier을 정리한 글입니다.Inline Question 1Why do we expect our loss to be close to -log(0.1)? Explain briefly. Your Answer : 가중치(W)가 랜덤한 작은 값으로 초기화 되었기 때문에 score function의 모든 결과가 0에 가깝습니다. 따라서 첫 번째 iteration에서 loss는 $-log(\frac{1}{C})$ 에 가깝습니다. (C: number of classes) sanity check을 이용해 알고리즘이 잘 작동하는지 확인할 수 있습니다.Inline Question 2Suppose the o..
CS231n Assignment 1(1) : K-Nearest Neighbor classifier
·
Stanford CS231n
Stanford에서 강의하는 CS231n의 Assignment 1(1): KNN을 정리한 글입니다.Inline Question 1Notice the structured patterns in the distance matrix, where some rows or columns are visibly brighter. (Note that with the default color scheme black indicates low distances while white indicates high distances.)1) What in the data is the cause behind the distinctly bright rows?2) What causes the columns? Your Answer : 1. d..
Lecture 11: Detection and Segmentation
·
Stanford CS231n
Stanford에서 강의하는 CS231n에 대해서 공부하고 정리한 글입니다.Slide: cs231n_2017_lecture10.pdf, lecture_9.pdf Computer Vision Tasks Computer Vision에는 수행할 수 있는 다양한 Task가 존재합니다. 그 중에는 객체를 구분하는 Classification, Pixel 단위로 class를 할당하는 Semantic Segmentation, 이미지(영상) 내 객체와 bbox를 검출하는 Object Detection, 객체 단위의 Segmentation을 수행하는 Instance Segmentation 등이 있습니다. 오늘은 이 중에서 Semantic Segmentation과 Object Detection에 대해서 다뤄보겠습니다.Sem..
Positional Encoding: sin/cos을 사용하는 이유
·
딥러닝
Positional Encoding의 필요성Transformer 모델은 입력 데이터를 한번에 병렬로 처리합니다. 데이터를 병렬로 처리함으로써 연산 속도가 빠르다는 장점이 있는 반면, 입력 데이터의 순서 정보가 사라지는 단점이 생기게 됩니다. 실제로, 입력 데이터의 순서를 바꿔도 출력 데이터의 순서만 바뀔 뿐 그 값은 동일합니다. 이를 Permutation equivariant 한 특징이라고 합니다. 따라서, 입력 데이터에 순서 정보를 추가해주기 위해 Positional Encoding 이라는 기법을 사용합니다.Positional Encoding의 필요 조건각 위치값은 시퀀스의 길이나 입력값에 관계없이 동일한 위치값을 가져야 합니다.모든 위치값이 입력값에 비해 너무 크면 안됩니다.Positional Enc..
Batch/Layer/Group Normalization
·
딥러닝
Batch/Layer/Group Noralization의 개념과 차이를 정리한 글입니다. BackgroundDNN 에서 Covariant Shift 문제를 해결하기 위해 Normalization이 제안되었습니다.Covariant Shift란 학습 과정에서 계층 별로 입력의 데이터 분포가 달라지는 현상을 말합니다. 각 계층은 FC 연산이나 Convolution 연산 등을 거친 뒤 activation function을 적용하게 됩니다. 그러면, 연산 전/후에 데이터 간 분포가 달라질 수 있습니다. 이 문제점을 개선하기 위해 Normalization 개념이 제안됩니다.Normalization 딥러닝에서 일반적으로 널리 쓰이는 4가지 Norm 기법을 정리해보았습니다. H와 W가 하나의 차원에 묶여있기 때문에 직..