목록Artificial Intelligence/Machine Learning (19)
ROKO
딥러닝은 모델의 parameter 자체가 많아 많은 데이터가 필요하다는 것을 알고 있다. 관련 생각을 하던중 궁금증이 생겼다. 어떠한 기준을 바탕으로 어느정도의 데이터가 필요할까? 딥러닝과 머신러닝을 학습시키기 위한 양은 비슷할까? 1번 질문 일반적으로 두가지의 대답을 할 수 있는데, "어떠한 프로젝트를 진행중이냐는 의존성"과 "많으면 많을수록 좋다"라는 것이다. 의존성에 대해 먼저 살펴보자 모델을 학습함에 있어 고려해야할 사항은 어떤 것들이 있을까. 문제의 복잡성 (정형, 비정형, 단변량, 다변량) 모델의 복잡성 (머신러닝, 딥러닝) 목표 성능 (허용 에러 수치) 문제의 복잡성이란 데이터의 단순함 정도를 의미할 수 있다. 대표적인 머신러닝 데이터셋인 iris를 예를 든다면 꽃에 대한 길이정보를 가지고 ..
Binary classification Targets : \(t \in \{ -1,+1 \} \) Linear model : \(z=w^{T}x+b, y=sign(z)\) Loss function : \(L_{0-1}=\mathbb{I} \{ y \neq t \} \) Hyperplane에 두 종류의 데이터가 표시되어있다. 이 두 종류의 데이터를 분류하기 위한 linear classifier로 위와같은 모델을 선택 할 수 있다. 하지만 가능한 모델은 하나일까? 아니라면 어떤 모델이 최선일까? Optimal Separating Hyperplane 직관적으로 보면 각 데이터를 분류하면서도 margin이 최대로 되어있는 linear classifier가 가장 적합하다. margin이 최대라는 뜻은 genera..
Gradient Checking 우리는 backpropagation 과정에서 weight update를 위해 direct derivative를 계산해야한다. 하지만 미분 불능의 경우도 존재하기에 근사식을 사용해 적용하게 되는데 미분값 오차가 있는지 없는지 검증하는 과정이 필요하다. Finite differences (유한차분) Let \(h\) be small value, e.g. \(10^{-10}\) \(\frac{\partial}{\partial x_{i}}f(x_{1},\cdots,x_{N})=\displaystyle \lim_{h \to 0}\frac{f(x_{1},\cdots,x_{i}+h,\cdots,x_{N})-f(x_{1},\cdots,x_{i},\cdots,x_{N})}{h}\) Gen..
Classification : Predicting a discrete-valued target Binary class (pos / neg, 0/1, true/false) Multiclass Binary linear classification linear model \(z = w^{T}x + b \) \(y=\left\{\begin{matrix} 1 \; if \; z \geq r\\ 0 \; if \; z < r \end{matrix}\right.\) w 가중치와 x를 곱하고 편향을 더한 결과가 임계값을 넘냐 아니냐로 분류를 할 수 있다. 조금 더 식을 정리 할 수 없을까? \(w^{T}x+b\geq r \Leftrightarrow w^{T}x+b-r\geq 0\) 상수부분을 하나로 묶어서 치환하자 그러..
Problem Setup 함수(Hypothesis)를 통해 변수 x에 대한 t값을 예측하는 게 목표 Given dataset pairs \(\left\{(x^{(i)},t^{(i)}) \right\}_{i=1}^{N}\), \(x^{(i)}\) = inputs, \(t^{(i)}\) = targets Model y is a linear function that y(predicition) = W(Weight)x + B(bias) Setting of the parameters = Hypotheses \(Loss\,function\) : \(L(y, t) = \frac{1}{2}(y-t)^2\) (squared error) / \(\frac{1}{2}\)은 미분을 활용한 컴퓨터 연산시 효율성을 위한 것 \((..
Ensemble (앙상블) Combine multiple models into a ensemble Better than the individual model Particularly well suited to decision trees in ML Intution : majority is less likely to make mistakes and has more information than individuals How to make different models with same structure? 앙상블은 여러 모델을 혼합하여 하나의 모델로 구성하는데 한 종류의 모델을 가지고 앙상블을 구성하기 위해서는 각 모델들이 구조는 같을 지라도 서로 다른 모델로 구분되어야한다. 이를 위해 아래와 같은 방식을 적용해..
Decision trees(결정 트리)의 기본적인 형태이다. Internal nodes(Decision nodes) 들은 속성을 test한다 Branch, 기준에 따라 가지가 나뉘어 진다 Leaf nodes 결과값을 의미한다. (predictions) CART(Classification and Regression trees)라고도 불린다 DT(Decision Trees) 고려할 점 모든 객체는 속성-값 pair로 구성 Target function은 이산변수을 다룸 명제 논리 필요 (Ex 키위는 지름이 10cm보다 작다) 이상치에 유연하게 대응 가능 일반화가 가능하도록 조정 Leaf node에 가능한 같은 Label에 해당하는 값들을 분류 DT를 모든 데이터에 대해 잘게 분류할 수 있지만 고려할점에 써있는..
Nearest Neighbor(최근접 이웃)은 ML의 대표적인 방법론 중 하나이다. NN을 논하기 전에 필요한 정의부터 살펴보자. ML은 training set을 통해 inductive learning(귀납적 학습) 최종 목표는 input \(x\)를 넣었을때 그에 해당하는 결과를 출력하는 함수 \(f(x)\) 이상적인 알고리즘은 쉽게 찾을수 없으므로 다양한 방법론을 통해 근사 이상적인 함수를 \(f\) (target function), 이에 근사하는 함수를 \(h\) (hypothesis) 가능한 모든 \(h\) 를 모아논 함수들의 공간을 Hypothesis space \(H\)(가설 공간)이라 하며 최적의 함수 \(h\) 를 찾는다. 이를 위해 training set에 대한 error function..
ML(Machine Learning)을 다루기 앞서 컴퓨터 공학에서 학습의 의미란 무엇일까? 컴퓨터 프로그램은 experience(E)이나 Data를 통해 학습하여 tasks들을 수행하고 performance measure(P)를 나타낸다. 즉, ML 은 데이터 학습을 통해 알고리즘을 자동으로 만드는 프로그래밍이다. 예를 들면 강아지와 고양이 사진 10000장을 구분하는 작업을 할때, 한장씩 사람이 구분하는것보다 사진에서 강아지와 고양이의 특징을 구분해 분류하는 알고리즘을 만들어 낸다면 작업효율이 올라갈 것이다. 그리고 프로그램이 분류 알고리즘 또한 스스로 학습할 수 있다면 우리는 좋은 데이터를 구하여 학습만 시키면 된다. ML은 데이터를 패턴을 파악하여 넣어주어야 하는데 DL(Deep Learning)..