이 기록은 내가 학기 중에 수강했던 Coursera의 'Deep learning specialization' 강의를 다시 복습하는 용도이다. 이미 2번 정도 학습을 마친 상태이고, 내 기준 헷갈리거나 메모하면 좋을 핵심 내용 위주로만 작성했다. 즉, 처음 수강하는 사람들에겐 내 복습 기록들이 도움이 되진 않을 수 있다. 그런 사람들에겐 직접 수강하고 자신만의 복습 노트를 만드는 것을 추천한다.

  

Binary Classification

  • Outputs are classified as 1 (cat) or 0 (non-cat)

Binary Classification

  • Convert an image input into three color channels: red, green, blue
    • 각 color channel들을 column 방식으로 나열한 후 한 column으로 합치기

 

Logistic Regression

  • Algorithm used for predicting the probability of a binary outcome
  • Sigmoid function used as an activation function:
    • Linear regression alone could result in negative outputs, not between 0 and 1

Graph of Sigmoid Function
Formula of Sigmoid Function

 

Logistic Regression Cost Function

  • Loss (error) function: Measuring the difference between 'y hat' and 'y' for a single training example
    • If y =1: L(y_hat, y) = -log(y_hat) => Want log(y_hat) large, so want y_hat large
    • If y=0: L(y_hat, y) = -log(1-y_hat) => Want log(1-y_hat) large, so want y_hat small

  • Cost function: for the whole training examples
    • Gradient Descent 과정에서 이 Cost function을 minimize하기 위한 w와 b를 찾을 것

m: the number of training examples

 

Gradient Descent

  • Algorithm for finding w and b that minimize J(w, b)
    • Gradient (Slope)을 구한 후에 Cost function J(w)이 최소값이 되도록 Parameters(w, b)를 업데이트하는 것

Graident Descent of w and b

  • Logistic Regression Derivatives

Key method: Chain rule

  • Logistic regression on m examples
    • Code implementation
      • 각 Parameter들을 update하기 위해서는 dw (dL/dw) 구해야한다는 점 알기

 

Vectorization

  • To avoid 'for loop' code: 'For loop' is time-consuming
  • Examples of Implementing Logistic Regression

 

Vectorizing Logistic Regression

  • Forward Propagation

  • Back Propagation

  • Code Implementation of Forward and Backward Propagation

+ Recent posts