Week 04: Neural Networks

Non-linear Hypotheses

Model representation 1

$\theta$를 weight라고도 하고 parameter라고도 한다.

activiation fucntion을 sigmoid (logistic)이라고도 한다.

Neural networks -notation

  • $a_i^{(j)}$, activiation of unit i in layer j

    • 해석하면 만약, $a_1^{2}$라고 하면 두번째 레이어에 있는 첫번째 유닉이라는 의미 이다.
  • $\theta_i^{(j)}$ 이란 결국 layer j에서 layer j+1로 연결 시켜주는 mapping function을 의미한다.

    • Prameters for controlling mapping from one layer to the next
    • $s_j$란 layer j에 있는 유닛을 말한다.
    • $s_{j+1}$ unit은 layer j+1에 있는 유을 말한다.
    • 결국 $\theta^j$의 dimension은 $s_{j+1}$ by $s_{j}+1$로 결정 된다.
      • 왜냐하면, $s_{j+1}$은 layer (j+1)의 유닉수와 같기 때문이다
      • is equal to the number of units in layer j, plus an additional unit
    • Looking at the Ɵ matrix
      • Column length is the number of units in the following layer
      • Row length is the number of units in the current layer + 1 (because we have to map the bias unit)

Model representation 2

Forward propagation: Vectorized implementation

이전에 설계한 구조를 아래와 같다.

이것을 formula로 좀더 정리해 보면

a^(2)는 R^3로 삼차원 vector를 의미한다.
x와 a^(1)은 같기 때문에 동일하다는 판단하에 지울 수 있다.

추가로 bias에 대해서 입력으로 넣어준다.
4차원 vector로 정의되고 R^4가 된다.

이러한 과정을 forward propagation이라고 한다.

Neural Network Learning its own features

아래의 그림과 같이 Neural netwrok이 하는 일은 그저 logistic regression이 하는 일과 같다.

단지, original features, $x_1$, $x_2$, $x_3$를 사용하는 것이 아닌
새로운 features, $a_1^2$, $a_2^2$, $a_3^2$를 사용하게 된다.

결국 이것을 이용해서 Hypothesis를 구현하게 되면 아래와 같다.

$$ h_{\theta}^{(x)} = g(\theta_{10}^{(2)} a_0^2 + \theta_{11}^{(2)} a_1^2 + \theta_{12}^{(2)} a_2^2 + \theta_{13}^{(2)} a_3^2 ) $$

위 equation은 완벽히 Logistic regression과 일치 한다.

Applications: Examples and Intuitions 1

Neural network이 어떻게 non-linear function을 간단히 해결 하는지 다루겠다.

AND의 경우

OR의 경우

Applications: Examples and Intuitions 2

Yann LeCun 교수의 handwritten digit classification에 관한 비디오이다.
Video

7.Multi-class classification

In this section, I want to tell you about how to use nerual entworks to do multiclass classification where we may have more than one category that we're trying to distinguish amongst.

이것은 an extention of the one versus all method 이다.

즉, 결과가 0이나 1이 아니라면 그것은 multiclass classification 이라고 할 수 있다.

하나의 예제로 pedestrian, car, motobike or truck 이 4가지중 하나를 추출하는 classification이 있다고 생각해 보자.
이것을 위해서는 output vector가 4개의 숫자를 가져야 한다.

  • 1 is 0/1 pedestrian
  • 2 is 0/1 car
  • 3 is 0/1 motocycle
  • 4 is 0/1 truck

만약 이미지가 pedestrian 이라면 [1,0,0,0]의 값을 얻게 된다.

결국 아래와 같이

$$ h_{\theta}^{(i)} = y^{(i)} $$
로 결정 된다.


+ Recent posts