본문 바로가기

728x90

DeepLearning Specialization(Andrew Ng)

(36)
[Week 2] 3. Learning from multiple tasks Learning from multiple tasks 1. Transfer learning 2. Multi-tasking learning 1. Transfer learning 1) 기본 개념 Transfer learning이란 특정 task(A)를 위해 만든 모델을 다른 task(B)를 위해 활용하기 위한 기법이다. 예를 들어 image recognition을 위한 모델을 만들고 이를 약간의 수정으로 radiology diagnose에 활용하는 것. 이를 위해서 output layer의 W와 b를 초기화하고 task B의 데이터로 초기화한 W와 b를 학습시킨다. 이 때, task B의 데이터가 많다면 더 많은 층의 W와 b를 학습시키면 된다. 왜냐하면 task B의 데이터가 많아질 수록 transfer 의..
[Week 2] 2. Mismatched training and dev/test set Mismatched training and dev/test set 1. Training and testing on different distributions 2. Bias and Variance with mismatched data distributions 3. Addressing data mismatch 1. Training and testing on different distributions 위와 같은 경우에 아예 randomly shuffle하고 train, dev/test set을 나누면 사실상 train set으로 dev/test 를 진행하는 것과 같다. 우리의 최종목표는 오른쪽의 사진들에 대해 모델을 적용시키는 것이므로 제일 이상적인 것은 오른쪽 사진들에 대한 데이터를 많아 모아 train, ..
[코세라] [Week 2] 1. Error Analysis Error Analysis 1. Carrying out error analysis 2. Cleaning up incorrectly labeled data 3. Build up your first system and then iterate 1. Carrying out error analysis - 오류분석은 수동으로 dev set에서 모델이 잘못예측한 example 들을 뽑아(about 100개) case 별로 나누는 것이다. 예를 들어 어떤 모델의 dev set에서의 accuracy가 90%(error가 10%)일 때, 강아지를 고양이로 잘못 예측한 경우가 100개 중 5개에 지나지 않는다면 강아지를 고양이로 잘못 예측한 경우를 시정하더라도 error를 9.5%로 밖에 낮추지 못한다. - 위와 같이 ca..
[Week 1] 3. Comparing to human-level performance Comparing to human-level performance 1. Why human-level performance? 2. Avoid Bias 3. Understanding human-level performance 4. Surpassing human-level performance 5. Improving your model performance 1. Why human-level performance? - Bayes Optimal error(Bayes error)는 ML의 성능이 절대 도달할 수 없는 영역이다. 그 이유는 data 자체가 판별불가능한 경우가 있기 때문인데, 예를 들어 판별불가능한 오디오, 너무 흐릿한 사진 등이 있다. 이에 대해서는 ML도 정확한 예측을 할 수 없기 때문. - 위와 ..
[Week 1] 2. Setting up your goal Setting up your goal 1. Single number evaluation metric 2. Satisficing and optimizing metric 3. Train / dev / test distribution 4. Size of dev and test set 5. When to change dev/test sets and metrics 1. Single number evaluation metric Actual N Actual P predict N TN FN predict P FP TP precision = TP / TP+FP recall = TP / TP+FN F1 score = 2 / (P^-1 + R^-1) F1 score 는 대표적인 single metric이다. 2. Satis..
[Week 1] 1. Introduction to machine learning strategy 1. Why ML strategy & 2. Orthogonalization 좋은 모델을 튜닝하기 위해서는 여러가지 전략이 필요하다. 그 절차를 쉽게 하기 위해 Orthogonalization(직교화)이라는 것을 활용한다. 직교화란, 1가지 효과를 위한 1가지 기능이라고 이해할 수 있다. 즉, A라는 효과를 위해 a라는 기능을 사용한다는 의미이다. a라는 기능은 오직 A라는 효과를 내는데에만 사용되는 것. 머신러닝의 개괄적인 목표는 위와 같으며 각각의 효과를 위한 기능들은 다음과 같다. 1) cost function이 training set 에 잘 fit 되는 것.
[Week 3] Programming Assignments 1. np.squeeze default로 아무것도 안쓰고 안에다가 array나 tensor를 넣으면 차원이 1인 것들을 다 날려준다. a = np.array([[1,2,3]]) a.shape => (1,3) print(np.squeeze(a)) => [1,2,3] print(np.squeeze(a).shape) => (3,) 2. Sess.run([optimizer, cost], feed_dict = ...) 여러개의 연산을 run시킬 수 있고, 이 때 뒤에부터 연산한다. cost -> optimizer
[Week 3] 4. Introduction to programming frameworks Tensorflow - placeholder는 변수 x를 선언하고 나중에 train할 때 feed를 통해 x에 값을 넣어준다. - session.run()을 할 때 안에 들어가는 계산에 상수가 사용된다면 그냥 그대로 계산되겠지만, placeholder가 포함되어 있는 경우, feed_dict를 통해서 x에 값을 넣어줘야함. - session 작업을 할 때, with를 쓰는 경우가 많은데 이를 이용하면 error exception에 도움이 된다.
[Week 3] 3. Multi-class classification Multi-class classification 1. Softmax Regression 2. Training a softmax classifier 1. Soft max Regression 별건 아니고 Logistic Regression의 일반화 버젼이라고 이해하면 된다. Logistic Regression이 C(class) = 2 일 때의 경우라고 한다면, Muliti-class classification은 C가 3이상인 모든 경우를 일컫는다. Logistic Regression에서는 단지 sigmoid 함수에 입력값을 넣으면 끝났지만, 이번에는 class의 개수가 여러개이므로 단순히 그렇게 계산되어서는 안된다. 캡쳐에서 확인할 수 있듯이 입력값이 class 개수만큼의 벡터로 나오므로, 우리가 산출해야할..
[Week 3] 2. Batch Normalization Batch Normalization 1. Normalizing activations in a network 2. Fitting Batch Norm into a neural network 3. Why does Batch Norm work? 4. Batch Norm at test time 1. Normalizing activations in a network 1) 기본개념 Normalization이 필요한 이유에 대해서는 Opimization 강의노트에 자세히 기술했으니 참고 바란다. 학습 속도를 높이기 위해 feature들을 Normalization하는 작업은 꼭 필요한데, 이를 통해 feature들의 scale을 맞춰주어 gradient descent 의 속도를 물리적으로 높일 수 있기 때문이다. 이건 ..

728x90