본문 바로가기

Deep Learning

(17)
Lec 6-2. Weight Initialization, Batch Normalization 이어서 weight parameter들을 어떻게 초기화할지(weight initialization)에 대한 방법들과 별도의 layer를 통해 이를 해결하는 batch normalization을 공부한다. Weight Initialization How about all-zero initialization? 가장 먼저 할 수 있는 생각은 모두 0으로 초기화하는 것이다. 이 때의 문제는 뉴런들을 통과한 output이 모두 같다는 것이다. 여러 개의 layer가 중첩되어 있을 때, 하나의 뉴런의 output은 다음 뉴런의 input이 된다는 점을 생각해보면, 뉴런들의 input도 모두 같아지게 된다. 뉴런의 input은 곧 이 뉴런 weight들의 local gradient에 해당하고, local gradien..
Lec 6-1. Activation Functions, Data Preprocessing Lecture 6, 7에 걸쳐서 neural network를 training시키는 과정에 있어 중요한 요소들을 다룬다. 이번 포스팅에서는 convolution/fc layer 이후에 수행하게 되는 activation/nonlinearity function의 종류와 특징, training data에 대한 preprocessing에 대해 정리해본다. Activation Functions General Scheme of Activation Functions with Neuron Neuron을 통과한 후 activation function을 통과하는 구조를 일반적으로 아래 그림과 같이 표현할 수 있다. 파란색, 빨간색 path는 각각 forward path, backpropagation를 나타낸다. ReLU는 ..
Lec 5. Convolutional Neural Network, Convolution Layer, Max Pooling Layer 이번 lecture에서는 computer vision 분야에서 사용되는 neural network를 구성하는 중요한 개념인 convolution layer에 대해 공부해본다. Convolution Layer: How it works? Idea: Compared to FC Layer... 이전 lecture에서 다뤘던 fc layer의 경우, 우선 input을 N*1 형태의 벡터로 표현한 뒤 weight matrix와의 행렬 곱을 통해 activation number를 얻었다. fc layer과 비교했을 때 convolution layer에서 가장 큰 차이점 중 하나는 spatial dimension을 유지한다는 것이다. 위의 슬라이드와 같이, 3차원 형태의 input 그대로 3차원 filter와 conv..
Lec 4-2. Introduction to Neural Network Linear Classifier = Building Block of Neural Network 이전에 linear classifier 개념이 처음 도입될 때, 이것은 복잡한 neural network의 basic building block을 이룬다고 하였다. Linear classifier가 뭘 하는지를 단순하게 표현하자면 학습된 weight들을 가지고 input에 대한 score output을 내는 역할을 한다. 이 때, 학습이 완료된 weight matrix의 각 행은 하나의 label에 대한 template이라는 의미를 갖는다. input 이미지 벡터가 들어오면 각 행과 내적을 수행함으로써 template matching을 하고 그 결과를 label에 대한 score로 주는 것이다. 그런데, 이 방..
Lec 4-1. Gradient with Computational Graph: Forward Path, Backpropagation, Vectorized Operation How to Calculate Analytic Gradient for Complex Function? Optimization 과정에서 loss function의 gradient 방향을 따라서 weight parameter들을 변화시키므로, loss function의 analytic gradient를 계산하는 방법이 필요하다. Lecture 4는 어떻게 복잡한 다변수 함수의 gradient를 계산할 것인지를 다루며, 이를 위해 computational graph와 backpropagation의 개념을 다룬다. Computational Graph: Forward path & Backpropagation 다변수 함수를 여러 개의 간단한 연산 단위로 쪼개서 node와 연산 gate로 나타낸 것을 computat..
Lec 3-2. Optimization: Gradient Descent, Stochastic Gradient Descent Optimization: How to find best weight parameters W? Loss function은 weight parameter들이 training dataset에 대해 얼마나 좋은 성능을 내는가에 대한 측정 지표이다. 그렇다면 좋은 성능을 내도록 weight parameter들을 어떻게 찾아갈 것인가? 이러한 문제를 optimization이라고 한다. Gradient Descent: Following direction of gradient Weight parameter는 I*c개이다. (I는 이미지 벡터의 size, c는 label 수일 때) Weight parameter들이 만들어내는 I*c 차원의 벡터 공간을 생각해보면, weight parameter들이 random하게 초기화..
Lec 3-1. Loss Function: Multiclass SVM, Softmax, Full Loss Loss Function: Measuring goodness of weight W 위와 같은 linear function으로 score를 계산하였을 때, 현재 weight matrix W가 ground truth label에 대해 어느 정도 정확도를 주는지에 대한 지표가 필요하다. 강의에서는 다소 비유적으로 현재의 weight matrix W가 주어진 training dataset에 대해 얼마나 happy한지를 측정한다고 했는데, 이러한 측정 지표가 되는 것이 loss function이다. Loss function을 정의하는 방법은 여러 가지가 있을 수 있고, 본 강의에서 다룬 multiclass SVM, softmax의 2가지를 포스팅에서 정리하려고 한다. 모델, 구체적으로 보면 weight matri..
Lec 2-2. Linear Classifier: Parametric Approach, Interpretation, Limitation Linear Classifier Neural network의 기본적인 building block을 이루는 linear classifier에 대해 살펴보기로 한다. Linear classifier의 기본적인 아이디어는 다음과 같다. 만약 10개의 class로 이미지를 분류하는 classifier인 경우, 각 class에 대한 score가 input x와 weight parameter W의 함수로 표현된다. Score 값이 가장 큰 label로 class를 판단하게 된다. 함수 중 가장 간단한 linear 함수를 가정하면, 아래 수식의 첫 줄과 같이 함수를 표현할 수 있다. 이 때, linear 함수에서 bias vector b를 포함하는 것이 더 유용함이 알려져 있다. 그래서 기본적인 linear clas..