todo:

  1. define a loss function that quantifies our un happiness with the scores across the training data
  2. come up with a way of efficiently finding the parameters that minimize the loss function (optimization)

스크린샷 2023-07-01 오후 8.25.20.png

  1. SVM - Hinge loss

    스크린샷 2023-07-01 오후 8.26.44.png

    Sj → 잘못된 레이블의 score

    Sy_i → 알맞는 레이블의 score

    +1 → safety margin

  2. Softmax - Cross entropy loss

    스크린샷 2023-07-01 오후 8.56.54.png

스크린샷 2023-07-01 오후 8.59.58.png

Q. what is the min/max possible loss L_i

A. x가 [0, 1]일 때 (확률이기 때문), [무한대, 0]

Q. usually at initialization W are small numbers, so all s ~= 0. what is the loss?

A. - log(1/3), -log(1/클래스 개수)

→ sanity check 용

  1. 둘을 비교

    스크린샷 2023-07-01 오후 9.05.56.png

Multiclass SVM optimization demo

Optimization

→ Loss를 minimize하는 Weight를 찾는 과정

스크린샷 2023-07-01 오후 9.12.56.png

R(W) → weight에만 영향을 받는 함수이다.

  1. 제일 안 좋은 방법 : random search 15.5%. SOTA ~ 95%

  2. Follow the slope (numerical gradient)

    스크린샷 2023-07-01 오후 9.15.06.png

  3. analytic gradient

    the loss is just a function of W

    미분만 알면 된다.

  4. 실제로는 언제나 analytic gradient를 사용하나, 계산이 잘 되고 있는지 확인하는 용도로 numerical gradient를 사용한다. 이를 gradient check라고 한다.