본문 바로가기
Lecture/IoT•인공지능•빅데이터 개론 및 실습 (2022-2)

1. Introduction to AI - 윤성로 교수님

by 재영(ReO) 2022. 9. 1.

개인적인 공부 내용 기록을 위한 포스팅입니다. 문제가 될 시, 삭제합니다.

🎵 인공지능이란?

  1. www.deepmind.com
    우주의 원자 수만큼 많은 경우의 수를 다루는 바둑의 경우 컴퓨터가 다루지 못할 것으로 생각되어 왔으나, 매우 효율적인 메모리 탐색 구조의 탄생으로 인해 'AlphaGo'가 가능하게 되었다.
  2. www.waymo.com
    자율주행. 주위에서 꾸준히 증가 중이다.
  3. www.nugu.co.kr
    인공지능 스피커. 많은 업무가 음성을 통해 이루어지는 경우가 증가하고 있다.
  4. www.ibm.com
    슈퍼컴퓨터.(IBM Watson). 의료 분야에서 인간보다도 더욱 정밀한 진찰이 가능함이 밝혀지며 많은 수요가 생기고 있다.

 

🎶 우리가 만들고자 하는 것

인간처럼 생각(think)하거나 행동(act)하는 기계

-> 인간 생각/행동의 핵심 요소
: 합리성(rationality)

-> 인공지능의 공학적 정의
: 합리적으로 생각/행동하는 기계를 만드는 일

✿ Turing test : the imitation game metirc.
컴퓨터가 인간처럼 대답을 하게 되면 (질문자가 구별하지 못하면) 인공지능을 구현했다고 판단한다.

합리성?
미리 정의된 목표를 최대로 성취하는 것.
목표(goal) : 결과물의 효용성(utility) 측면으로 표현된다.
Rationality = maximizing expected utility
AI = computational rationality

 

🎶 AI가 풀고자 하는 문제들

1. Reasoning, problem solving
2. Knowledge representation
3. Planning
4. Learning
5. Natural language processing
6. Perception (ex. computer vision)
7. Motion and manipulation
8. Social intelligence
9. Creativity
10. General intelligence

 

🎶 접근방법

1. Cybernetics and brain simulation
2. Symbolic
3. Statistical
4. Integrative

 

🎶 Tools

1. Search and optimization
: 최적화 - 방대한 data에서 효율적이고 빠른 search를 하도록 하는 것. ex) simulated annealing, genetic algorithms
2. Logic
3. Probabilistic methods for uncertain reasoning ex) Bayesian networks
4. Classifiers and statistical learning methods ex) decision tree, support vector machine (SVM)
5. Artificial neural networks and deep learning

 

🎵 기계학습 (Machine Learning)

인공지능의 한 분야.
Definition : giving computers the ability to "learn" with data, without being explicitly programmed.
"learn"? -> progressively improve performance on a specific task

 

🎶 학습 방법

1. 지도학습 : 정답이 있는 데이터로 학습.
2. 비지도학습 : 정답없이 데이터 만으로 학습.
3. 강화학습 : 주변과의 상호작용(interaction)으로 학습
4. 기타 : ex) semi-supervised learning, online learning, transfer learning, continual learning, etc.

 

🎶 딥러닝 (Deep Learning)

기계학습의 한 분야.
기계학습의 특징을 다 가지고 있다. (데이터를 주면 그 데이터로 스스로 학습 하는 것.)
여기에 추가로 표현형 학습 (representation learning) 이라는 특징을 가진다.
특징(feature)을 계층적(hierachically)으로 자동 학습
데이터가 너무 복잡해서 있는 그대로 분석하기 어려운 경우가 많다. 데이터로부터 중요한 특징을 뽑아서 분석하게 되는 경우가 많다. 그 예로, 병원의 영상의학 전문의만 x-ray 등의 영상을 판독할 수 있는 이유는 질병의 특징을 판단할 수 있기 때문이다. 이러한 과정이 딥러닝은 자동으로 일어날 수 있다. 각광받게 된 원인이다. 아래는 기계학습이 가능해진 배경이다.
1. Big data 확보
2. GPU 등 하드웨어 발전
3. 각종 알고리즘의 진보

 

🎶 기계학습 기초

1. Learning from Data

✿ Eseence
1. Data : 학습 자체가 데이터로부터 오기 때문에.
2. Pattern in the data
3. Difficult to explain / understand mathematically : 딱 떨어진다면 머신러닝까지 필요없고 기초 학문 수준에서 정리 가능하기 때문에.

 

2. Problem Formulation

Fintech example -> pdf 확인
✿ Components of learning
1. learning algorithm A
2. hypothesis set H
3. learning model A and H
✿ Basic setup
1. unknow target function
2. training example, hypothesis set
3. learning algorithm
4. final hypothesis

 

3. Perceptron

classifier이다. 이진 classifier이다.

  1. Making a decision
    to make a decision?
    -> weighted coordinates : 가중치
    -> the resulting score : threshold(임계값)을 비교
  2. the 'perceptron'
    h를 linear formula로 가정한다.
    가중치의 총합에서 threshold를 빼주고 sign 씌우면 바운더리인 h(x)를 설정 가능하다.
    이 과정에서 threshold라는 값을 b(bias)로 대체한다.
    이 모델을 perceptron이라고 한다. deep neural network의 기본이 된다.

  3. example : 2D case
    misclassified 된 line의 모양과 위치를 조정하기 위해서 w1,w2(가중치),b(bias)를 조정한다.
    라인의 방정식을 w1x1+w2x2+b=0 이라고 하자.
    b=w0로 하고, x0라는 가상의 차원을 설정하고 그 값을 1로 가정함.
    이렇게 하면 Line의 방정식을 W^T * X (W^T : transposed)라는 두 벡터 내적으로 간단히 표현 가능하다.

  4. Perceptron learning algorithm (PLA)
    objective -> determine optimal w based on the data to produce g(function)

assumption : the data set is linearly separable
PLA? -> an iterative algorithm (반복이 많으므로 많은 연산을 필요로 한다. 그러므로 gpu가 많이 쓰인다.)
PLA는 guaranteed to converge for linearly separable data, 즉 완벽히 분류 가능하다.

How PLA works?
: h(x) = sing(W^TX), given traning set (xi,yi) (i=1~N)
sign(W^T
Xn) != yn 일 경우 misclassified 이므로 w를 w+ynxn으로 update한다.
이 과정을 기하학적으로 보면, 서로 둔각을 이루는 벡터에 ynxn을 더해줌으로써 예각으로 만들어주는 것이다. (yn은 1 or -1이므로)

4. Learning Paradigms

  1. Supervised learning
    Most studied and most utilized
    setting -> Training data는 답도 함께 가지고 있다.
    well-known approaches : classification, regression
    variants도 다양하게 있다.
    flow는 크게 두가지로 나눠진다. 1.traning phase와 2.testing phase. 당연하지만, traning phase가 더 많은 시간과 resource를 필요로 한다.

  2. Reinforcement learning
    an "Agent" -> sholud take actions in an environment, so as to maximize cumulative reward.
    Learn by "interactions" -> supervised는 명시적으로 학습하지만 강화학습은 환경과의 interaction을 통해서 학습한다.

  3. Unsupervised learning
    No output information in training data -> 입력만 주어진다.
    ex) clustering
    purpose? : 1.internal structure 2.precursor to supervised learning 3.representation learning

5. Error and Noise

  1. Error (cost, objective, rist)
    unknown target인 f와 우리가 예측한 h가 얼마나 유사한지를 측정하는 개념.
    error를 이용하여 w로 불리는 기계학습의 parameter가 training이 되므로 모델에 아주 큰 영향을 줌.

  2. Noise
    about the nature of the target function -> error는 실제와 가정의 차이이지만 noise는 실제모델 자체에 더 집중.

  3. Error measure
    ex) squared error, binary error etc.
    pointwise error의 평균을 내서 모델의 성능을 평가한다.
    two types of error
    1. in-sample error : 트레이닝 데이터로부터 측정한 pointwise error의 평균값.
    2. out of sample error : 모집단과의 에러값. 측정할 수 없다.
    pointwise error는 어떻게 정의하는가? -> 모델과 상황마다 다르다.

  4. Noisy targets
    'target function' is not always a function -> so, 어떤 함수가 아니라, 분포 라고 하는 것이 낫다.
    because usually the data we learn from were generated not by a deterministic target function, but in a noisy way such that the output is not uniquely determined by the input

  5. target distribution
    함수로 정의하는 것 보다는 y ~ P(y|x)로 분포로 얘기하는 것이 더 좋은 경우가 많다.

  6. the learning diagram (updated)
    error의 역할 -> 최적의 Final Hypothesis를 찾는 데에 쓰인다.
    noise의 역할 -> target function에서 target distribution으로.

 

6. Feasibility of learning

  1. Target f
    unknown -> we cannot learn f deterministically, but we can learn f in a probabilistic sense
    ✿ PAC learning
    : Probably, Approximately, Correct

  2. Ultimate goal of learning
    making Eout(out-of-sample error)~0 -> generalization capability

  3. feasibility of learning
    split into two questions
    1. can we make sure that Eout(g)~Ein(g) ?
    2. can we make Ein(g)~0 ?
    if can answer yes to both -> Eout(g)Ein(g)0
  • Answer to Q1
    theoretical : VC analysis, bias-variance analysis (특정 조건 만족하면 1번 질문 참.)
    그럴려면, better for simpler models 모델이 간단해야함.
    실제 모델 개발 시에 insample 데이터는 통과하나 outofsample 데이터에서는 안맞을 수 있다. -> overfitting 일어난 것이다. -> need regularization.
  • Answer to Q2
    more practical : run A on training data D (A : model(algorithm))
    better for more complex models
    만약 안맞는 상황이라면? -> underfitting 일어난 것임 -> need better optimizer

  1. Trade-off
    true for any machine learning system
    approximation - generalization tradeoff
    (approximation(Ein과 연관,bias)과 generalization(Ein-Eout과 연관,var)은 상충하기 때문에 최선의 balance를 찾아야한다.)

출처 : 윤성로 교수님 강의자료